mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
docs(demos/platform): api demo
This commit is contained in:
2
demos/platform/app.html
Normal file
2
demos/platform/app.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<ion-nav id="nav" [root]="rootPage" #content></ion-nav>
|
||||
<ion-overlay></ion-overlay>
|
||||
23
demos/platform/index.ts
Normal file
23
demos/platform/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import {App, Page, IonicApp, Platform} from 'ionic/ionic';
|
||||
|
||||
@App({
|
||||
templateUrl: 'app.html'
|
||||
})
|
||||
class ApiDemoApp {
|
||||
|
||||
constructor() {
|
||||
this.rootPage = InitialPage;
|
||||
}
|
||||
}
|
||||
|
||||
@Page({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class InitialPage {
|
||||
constructor(platform: Platform) {
|
||||
this.isIos = platform.is('ios');
|
||||
this.isAndroid = platform.is('android');
|
||||
this.userAgent = platform.userAgent();
|
||||
}
|
||||
}
|
||||
|
||||
16
demos/platform/main.html
Normal file
16
demos/platform/main.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<ion-navbar *navbar>
|
||||
<ion-title>Platform</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<ion-row>
|
||||
<b>.is('android'):</b> {{isAndroid}}
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<b>.is('ios'):</b> {{isIos}}
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<b>.userAgent():</b> {{userAgent}}
|
||||
</ion-row>
|
||||
<ion-content>
|
||||
@@ -13,6 +13,7 @@ import {ready, windowDimensions, flushDimensionCache} from '../util/dom';
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @demo /docs/v2/demos/platform/
|
||||
*/
|
||||
export class Platform {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user