我有一个用 ionic 4 和 angular 7 开发的旧应用程序,有一个组件显示模态-A,然后模态-A 呈现模态-B,当模态-B 被解除时,将数据传递给模态-A,后者解除并传递数据到组件,现在我想切换到angular 8,新app可以呈现modal-A和modal-B,但是当modal-B关闭时,modal-A不关闭,组件是这样呈现modal-A的:
const modal = await this.modalCtrl.create({
component: SelectorItemsPage,
componentProps: {
item: this.item,
title: this.text,
service: this.service,
filterFunction: this.filterFunction,
sorterFunction: this.sorterFunction,
createPopup: this.createPopup
}
});
modal.onDidDismiss().then(data => {
this.item = data.data
this.selectedItem.emit(data.data)
this.writeValue(this.item)
modal.dismiss(this.item)
})
return await modal.present()
这就是modal-A呈现modal-B的方式:
const modal = await this.modalCtrl.create({ component: this.createPopup })
modal.onDidDismiss().then(item => {
this.modalCtrl.dismiss(item.data)
})
return await modal.present()
提前致谢