一級(jí)頁(yè)面
1.創(chuàng)建按鈕
<button ion-button (click)="presentCtrl()">跳轉(zhuǎn)</button>
2、構(gòu)造函數(shù)
constructor(public navCtrl: NavController,public modalCtrl: ModalController) {
this.dataArr = ["a","b","c"];
this.myParam = "123";
// this.modelP = ModelPage;
}
- 動(dòng)作
presentCtrl(){
let myModal = this.modalCtrl.create( ModelPage, { 'myParam': this.myParam });
myModal.present();
// this.navCtrl.push(this.modelP);
}
二級(jí)頁(yè)面 // 獲取界面跳轉(zhuǎn)的參數(shù)
constructor(
public viewCtrl: ViewController,
params: NavParams
) {
// 獲取界面跳轉(zhuǎn)的參數(shù)
this.myParam = params.get('myParam');
}
返回
// 界面 消失
dismissCtrl(){
this.viewCtrl.dismiss();
}