3
我需要知道我的模態已關閉。似乎沒有一個明確的方式來做到這一點與ionViewDidLeave或類似的東西。我嘗試了ionViewDidLeave,並且感覺它不適用於模式關閉,因爲我沒有使用navController移動到該頁面,而是使用模式顯示頁面。如何偵聽模態關閉事件?
home.ts
/*show modal with post form on add event page */
postEvent(){
let modal = this.modalCtrl.create(AddEvent);
modal.present();
}
AddEvent.TS
/* Close modal and go back to feed */
close(){
this.viewCtrl.dismiss();
//I need to change a value on the home page when this dismiss happens.
}