【问题标题】:Module Federation Loading Nested App route模块联合加载嵌套应用程序路由
【发布时间】:2022-07-12 17:20:08
【问题描述】:

我在以下结构中有一个应用

---主应用程序(路由器出口>)
--动物()
-仪表板。 (网址应用程序/狗/仪表板)

--动物(路由器插座>)
-仪表板(网址应用程序/猫/仪表板)

现在我想分离Dashboard组件,即DogDashboard和CatDashboard,并通过模块联合通过Animal组件的router-outlet加载它。

到目前为止,我可以做的是将主应用程序创建为外壳,为 Dogdasboard 创建另一个应用程序,但是当我通过遥控器导航到 cat 仪表板时,使用的是父路由器插座而不是子路由器插座(动物路由器插座)。知道这是否可以做到吗?

【问题讨论】:

    标签: javascript angular micro-frontend webpack-module-federation angular-module-federation


    【解决方案1】:

    您可以将匹配器与@angular-architects/module-federation-tools 的“startsWith”一起使用

    看一看:https://www.angulararchitects.io/en/aktuelles/multi-framework-and-version-micro-frontends-with-module-federation-your-4-steps-guide/

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 2020-10-01
    • 1970-01-01
    • 2019-08-04
    • 1970-01-01
    • 2020-09-22
    • 2012-06-30
    • 1970-01-01
    • 2021-08-06
    相关资源
    最近更新 更多