如何解除平台恢复中的所有弹出窗口? [英] How to dismiss all popups at the platform resume?
问题描述
在我的应用程序中,我有这个警告:
In my application, I have this alert:
let confirm = this.alertCtrl.create({
title: 'Blabla',
message: 'blablabla',
buttons: [button1, button2, button3],
enableBackdropDismiss: false
});
confirm.present();
此外,当应用程序恢复时,应用程序应重定向到登录页面。做这项工作没问题。
Also, when the application is resumed, the application should redirect to login page. No problem in making that work.
问题来了,当我打开弹出窗口并恢复应用程序时。应用程序确实正确重定向,但弹出窗口仍然打开。
The problem comes, when I open the popup and resume the application. The application does redirect correctly, but the popup remains opened.
是否有解决方案以编程方式关闭所有打开的弹出窗口?从app.component调用resume函数:
Is there a solution to programatically close all the popups opened? The resume function is called from app.component:
this.platform.resume.subscribe(() => {});
因此我无法调用confirm变量并关闭此弹出窗口。
For this reason I cannot call confirm variable and close this popup.
推荐答案
您可以从不同的地方订阅同一个活动。因此,您可以从确认$的组件中调用
this.platform.resume.subscribe(()=> {});
可以访问c $ c>变量。
You can subscribe to the same event from different places. So, you can call this.platform.resume.subscribe(() => {});
from the component where your confirm
variable is accessible.
这篇关于如何解除平台恢复中的所有弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!