mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
chore(build): fix demo compile errors, tslint errors
fix demo compile errors, tslint errors
This commit is contained in:
60
demos/src/navigation/AppModule.ts
Normal file
60
demos/src/navigation/AppModule.ts
Normal file
@ -0,0 +1,60 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule, NavController } from 'ionic-angular';
|
||||
|
||||
let pageNum = 2;
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
push() {
|
||||
this.navCtrl.push(PushPage);
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class PushPage {
|
||||
pageNum = pageNum;
|
||||
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
push() {
|
||||
pageNum++;
|
||||
this.navCtrl.push(PushPage);
|
||||
}
|
||||
|
||||
pop() {
|
||||
if (pageNum > 2) {
|
||||
pageNum--;
|
||||
}
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PushPage,
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
14
demos/src/navigation/main.html
Normal file
14
demos/src/navigation/main.html
Normal file
@ -0,0 +1,14 @@
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar>
|
||||
<ion-title>Navigation</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<button ion-button block (click)="push()">Push New Page</button>
|
||||
|
||||
</ion-content>
|
15
demos/src/navigation/page.html
Normal file
15
demos/src/navigation/page.html
Normal file
@ -0,0 +1,15 @@
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar>
|
||||
<ion-title>Page {{pageNum}}</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<button ion-button block (click)="push()">Push Another Page</button>
|
||||
<button ion-button color="secondary" block (click)="pop()">Pop This Page</button>
|
||||
|
||||
</ion-content>
|
Reference in New Issue
Block a user