mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
28 lines
551 B
TypeScript
28 lines
551 B
TypeScript
import {IonicView, Device} from 'ionic/ionic';
|
|
|
|
|
|
@IonicView({
|
|
template: `
|
|
<ion-navbar *navbar>
|
|
<button menuToggle>
|
|
<icon menu></icon>
|
|
</button>
|
|
<ion-title>Device</ion-title>
|
|
</ion-navbar>
|
|
<ion-content padding>
|
|
<h2>Device</h2>
|
|
<button primary outline (click)="doDevice()">Get Device</button>
|
|
<div *ng-if="device">
|
|
Device name: {{device.name}}
|
|
</div>
|
|
</ion-content>
|
|
`
|
|
})
|
|
export class DevicePage {
|
|
|
|
doDevice() {
|
|
this.device = Device.getDevice();
|
|
console.log('Got device', this.device);
|
|
}
|
|
}
|