Native demo update

This commit is contained in:
Max Lynch
2015-09-14 11:52:09 -05:00
parent 28c8d001e6
commit 5cbed7c25d
4 changed files with 16 additions and 7 deletions

View File

@ -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]);
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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>