如何通过路线打开离子4模态?
How to open ionic 4 modal via routes?
我需要打开模态 vis 路由。
我试过这样,但是没用
ngOnInit() {
this.presentModal();
}
async presentModal() {
const modal = await this.modalController.create({
component: AuthPasswordRecoveryPage,
componentProps: { }
});
return await modal.present();
}
在你的函数中尝试这个承诺链而不是异步等待:
presentModal() {
this.modalController
.create({
component: AuthPasswordRecoveryPage,
componentProps: { }
})
.then(modalEl => {
modalEl.present();
})
}
我需要打开模态 vis 路由。
我试过这样,但是没用
ngOnInit() {
this.presentModal();
}
async presentModal() {
const modal = await this.modalController.create({
component: AuthPasswordRecoveryPage,
componentProps: { }
});
return await modal.present();
}
在你的函数中尝试这个承诺链而不是异步等待:
presentModal() {
this.modalController
.create({
component: AuthPasswordRecoveryPage,
componentProps: { }
})
.then(modalEl => {
modalEl.present();
})
}