我构建了一个ionic 2
应用,并且我在登录后使用ModalViewController
导航到登录页面并重定向到主页in,但我想在模式关闭后刷新页面。
所以我的问题:如何在模态结束后重新加载页面?
我的代码:
showCustomToast(message: string, position: string) {
let toast = this.toastCtrl.create({
message: message,
duration: 5000,
showCloseButton: true,
closeButtonText: "Login"
});
let closedByTimeout = false;
let timeoutHandle = setTimeout(() => { closedByTimeout = true; toast.dismiss(); }, 5000);
toast.onDidDismiss(() => {
if (closedByTimeout) return;
clearTimeout(timeoutHandle);
// Dismiss manually
let profileModal = this.modalCtrl.create(LoginPage, {isModal: true});
profileModal.present();
});
toast.present();
}
}