mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
54 lines
874 B
TypeScript
54 lines
874 B
TypeScript
import { Component, NgModule } from '@angular/core';
|
|
|
|
import { IonicModule, NavController, NavParams } from 'ionic-angular';
|
|
|
|
|
|
@Component({
|
|
templateUrl: 'main.html'
|
|
})
|
|
export class ApiDemoPage {
|
|
myParam: string = '';
|
|
|
|
constructor(public navCtrl: NavController) {}
|
|
|
|
pushParams() {
|
|
this.navCtrl.push(PushPage, { 'myParam': this.myParam });
|
|
}
|
|
}
|
|
|
|
|
|
@Component({
|
|
templateUrl: "page.html"
|
|
})
|
|
export class PushPage {
|
|
myParam: string;
|
|
|
|
constructor(params: NavParams) {
|
|
this.myParam = params.get('myParam');
|
|
}
|
|
}
|
|
|
|
|
|
@Component({
|
|
template: '<ion-nav [root]="root"></ion-nav>'
|
|
})
|
|
export class ApiDemoApp {
|
|
root = ApiDemoPage;
|
|
}
|
|
|
|
@NgModule({
|
|
declarations: [
|
|
ApiDemoApp,
|
|
ApiDemoPage
|
|
PushPage
|
|
],
|
|
imports: [
|
|
IonicModule.forRoot(ApiDemoApp)
|
|
],
|
|
bootstrap: [IonicApp],
|
|
entryComponents: [
|
|
ApiDemoPage
|
|
]
|
|
})
|
|
export class AppModule {}
|