角度拦截器和对话框

发布于 2025-01-14 09:35:57 字数 255 浏览 3 评论 0原文

因此,我们有一个 HTTP 拦截器,它将通过对话框提示用户(需要按下按钮)。

我的问题是,如果我愿意,如何允许我的 UI 组件与 Http 拦截器交互以关闭此对话框。我们目前正在捕获 BACK/FWD 按钮按下情况,并提示是否发现未保存的数据。同时,后端服务可能会通过对话框进行提示,并且用户只想返回到上一个页面。该对话框仍然存在,我找不到如何关闭它的解决方案。我已经添加了一个dialogRef到HTTP拦截器和一个close()方法来关闭它,但我没有看到任何人真正做这样的事情?

So we have an HTTP Interceptor that will prompt the user with a dialog (requiring a button press).

My question is how do I allow my UI Component to interface with the Http Interceptor to close this dialog if I wanted to. We are currently capturing BACK/FWD button presses and prompting if unsaved data is found. At the same time the back end service could have prompted with a dialog and the user simply wants to go back to his last page. That dialog is still up and I can't find a solution for how to close it. I've added a dialogRef to the HTTP inteceptor and a close() method to close it but I'm not seeing anyone who actually does anything like this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文