ModalController 消除函数调用离子或角度中的其他组件
**other component html file where want call dismiss function**
<ion-col size="2" class="btn-center">
<ion-buttons class="btn-close">
<ion-button (click)="onCloseComponent()">
<ion-img src="/assets/img/closebtn.svg"></ion-img>
</ion-button>
</ion-buttons>
</ion-col>
组件ts是父组件
async presentTextModal() {
this.blocksToolsTextComponentModal = await this.modalController.create({
component: BlocksToolsTextComponent,
cssClass: 'blocks-tools-text',
swipeToClose: true,
initialBreakpoint: 0.3,
breakpoints: [0, 0.3],
});
return await this.blocksToolsTextComponentModal.present();
}
大家好,我想通过点击另一个组件来调用另一个组件的dismiss函数。调用模态的函数位于一个组件中。我什至需要在调用的模式中有一个单击按钮来关闭模式。也就是说,在打开的组件中我调用dismiss函数。我在框架中使用 modalController ionic。谢谢你的建议
**other component html file where want call dismiss function**
<ion-col size="2" class="btn-center">
<ion-buttons class="btn-close">
<ion-button (click)="onCloseComponent()">
<ion-img src="/assets/img/closebtn.svg"></ion-img>
</ion-button>
</ion-buttons>
</ion-col>
component ts which is parent
async presentTextModal() {
this.blocksToolsTextComponentModal = await this.modalController.create({
component: BlocksToolsTextComponent,
cssClass: 'blocks-tools-text',
swipeToClose: true,
initialBreakpoint: 0.3,
breakpoints: [0, 0.3],
});
return await this.blocksToolsTextComponentModal.present();
}
Hello everyone, I want to call the dismiss function from another component by clicking on another component. A function that calls a modal is in one component. I even need to have a click button in the summoned modal that closes the modal. That is, in the opened component I call the dismiss function. I am using modalController ionic in the framework. thank you for advice
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论