import { Component } from '@angular/core';
import { IonicPage, NavController} from 'ionic-angular';

import { ShareService } from '../../services/share/share';


/**
 * Generated class for the DevicesPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-devices',
  templateUrl: 'devices.html',
})
export class DevicesPage {

  private devices;
  constructor(public navCtrl: NavController, public shareService: ShareService) {
    this.devices = this.shareService.getDevices();
    //alert(this.devices.length);
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad DevicesPage');
  }

  selectRadio(device) {
    this.shareService.setRootDevice(device);
    this.navCtrl.pop();
  }

}
