Tighten up device

This commit is contained in:
Max Lynch
2015-09-14 14:36:14 -05:00
parent a53330cd31
commit 26394ebfa2
2 changed files with 12 additions and 5 deletions

View File

@ -1,4 +1,4 @@
import {IonicView} from 'ionic/ionic';
import {IonicView, Device} from 'ionic/ionic';
@IonicView({
@ -12,7 +12,8 @@ import {IonicView} from 'ionic/ionic';
<ion-content class="padding">
<h2>Device</h2>
<button primary outline (click)="doDevice()">Get Device</button>
<div>
<div *ng-if="device">
Device name: {{device.name}}
</div>
</ion-content>
`
@ -20,7 +21,7 @@ import {IonicView} from 'ionic/ionic';
export class DevicePage {
doDevice() {
let device = Device.getDevice();
console.log('Got device', device);
this.device = Device.getDevice();
console.log('Got device', this.device);
}
}

View File

@ -20,7 +20,13 @@ export class Device {
return this.ifPlugin(window.device, () => {
return device;
}, () => {
return {}
return {
name: Device.getName(),
model: Device.getModel(),
platform: Device.getPlatform(),
uuid: Device.getUUID(),
version: Device.getVersion()
}
});
}