mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00

- add spacing between imports - alphabetize imports - removed app.html files in favor of an inline ion-nav - cleaned up config demo so it uses proper syntax - use file name main.html for the first page for the demo - name the app ApiDemoApp and first page ApiDemoPage - replace the ion-toolbars with ion-navbars closes #7019 closes driftyco/ionic-site#647
49 lines
738 B
TypeScript
49 lines
738 B
TypeScript
import { Component } from '@angular/core';
|
|
|
|
import { Config, ionicBootstrap, NavController, NavParams, Platform } from 'ionic-angular';
|
|
|
|
var PAGE_NUM = 2;
|
|
|
|
|
|
@Component({
|
|
templateUrl: 'main.html'
|
|
})
|
|
export class ApiDemoPage {
|
|
constructor(public nav: NavController) {}
|
|
|
|
push() {
|
|
this.nav.push(PushPage);
|
|
}
|
|
}
|
|
|
|
@Component({
|
|
templateUrl: "page.html"
|
|
})
|
|
export class PushPage {
|
|
pageNum = PAGE_NUM;
|
|
|
|
constructor(private nav: NavController) {}
|
|
|
|
push() {
|
|
PAGE_NUM++;
|
|
this.nav.push(PushPage);
|
|
}
|
|
|
|
pop() {
|
|
if (PAGE_NUM > 2) {
|
|
PAGE_NUM--;
|
|
}
|
|
this.nav.pop();
|
|
}
|
|
}
|
|
|
|
|
|
@Component({
|
|
template: '<ion-nav [root]="root"></ion-nav>'
|
|
})
|
|
class ApiDemoApp {
|
|
root = ApiDemoPage;
|
|
}
|
|
|
|
ionicBootstrap(ApiDemoApp);
|