mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
Native demo update
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import {Component} from 'angular2/angular2';
|
||||
import {Control, ControlGroup} from 'angular2/forms';
|
||||
|
||||
import {App, Http} from 'ionic/ionic';
|
||||
import {IonicApp, App, Http} from 'ionic/ionic';
|
||||
|
||||
import {Camera, Geolocation, Vibration, Battery, Device} from 'ionic/ionic';
|
||||
|
||||
@ -16,8 +16,10 @@ import {VibrationPage} from 'pages/vibration';
|
||||
@App({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class IonicApp {
|
||||
constructor() {
|
||||
class MyApp {
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
|
||||
this.firstPage = CameraPage;
|
||||
console.log('First page', CameraPage);
|
||||
this.plugins = [
|
||||
@ -30,4 +32,11 @@ class IonicApp {
|
||||
{title: 'Vibration', page: VibrationPage},
|
||||
]
|
||||
}
|
||||
|
||||
openPage(menu, page) {
|
||||
menu.close();
|
||||
|
||||
let nav = this.app.getComponent('myNav');
|
||||
nav.setItems([page.page]);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<ion-menu #menu [content]="content" id="mainMenu">
|
||||
<ion-menu #menu [content]="content">
|
||||
<ion-toolbar><ion-title>Plugins</ion-title></ion-toolbar>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
@ -9,4 +9,4 @@
|
||||
</ion-content>
|
||||
</ion-menu>
|
||||
|
||||
<ion-nav #content swipe-back-enabled="false" [root]="firstPage"></ion-nav>
|
||||
<ion-nav #content swipe-back-enabled="false" [root]="firstPage" id="myNav"></ion-nav>
|
||||
|
@ -7,7 +7,7 @@ import {IonicView} from 'ionic/ionic';
|
||||
<a menu-toggle>
|
||||
<icon menu></icon>
|
||||
</a>
|
||||
<ion-title>Vibration</ion-title>
|
||||
<ion-title>Device</ion-title>
|
||||
</ion-navbar>
|
||||
<ion-content class="padding">
|
||||
<h2>Device</h2>
|
||||
|
@ -8,7 +8,7 @@ import {Geolocation} from 'ionic/ionic';
|
||||
<a menu-toggle>
|
||||
<icon menu></icon>
|
||||
</a>
|
||||
<ion-title>Vibration</ion-title>
|
||||
<ion-title>Geolocation</ion-title>
|
||||
</ion-navbar>
|
||||
<ion-content class="padding">
|
||||
<h2>Geolocation</h2>
|
||||
|
Reference in New Issue
Block a user