admin管理员组文章数量:1287838
I'm new to the world of microfrontends and I'm facing an issue.
I have an application with a microfrontend architecture, and I'm using single-spa-angular to mount and unmount my apps when needed.
Here's my problem:
I have a page in microapp1 that contains a form. The URL is microapp1/form. On this same page, there's a button that, when clicked, navigates to a page in microapp2, at microapp2/home.
My question is: if there are unsaved changes in the form, I don’t want the navigation to microapp2/home to happen, nor do I want microapp2 to be mounted.
Regarding route navigation, if I move from microapp1/form to microapp1/home while having unsaved data, I can use Angular's canDeactivate guard to prevent navigation. However, this guard does not seem to work when navigating between different microfrontends.
My questions are:
1- Why does canDeactivate work only between routes within the same microfrontend?
2- Is there a way to use a guard (or something similar) to prevent navigation between different microfrontends in single-spa? Any guidance would be greatly appreciated!
本文标签: routesPrevent navigation between microfrontends in singlespaangularStack Overflow
版权声明:本文标题:routes - Prevent navigation between microfrontends in single-spa-angular - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741248666a2365379.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论