第三方模块的覆盖路由

时间:2019-02-21 13:18:45

标签: angular angular-ui-router

在我的应用程序中,我使用的是库路由模块,其中包含一些路由定义(实际上是路由树)。

现在我需要在他的一个分支上添加一条新路线。

示例: 这是库的路由树:

-login
--> form
--> register
-main
-->dashboard
-->userinfo
-----> details

在我自己的应用程序中,我需要添加其他路径:main/userinfo/moredetails

我尝试过这种方法:

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    SharedLibModule,
    ThirdPartyModule,  <-- this is the 3° party modules that contains predefined routes
    RouterModule.forRoot([
      {
        path: 'main/userinfo/:id/moredetails', <-- this is the path I'd like to add
        loadChildren: 'main/userinfo/moredetails.module#MoreDetailsModule',
      }
    ]),
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

有没有办法实现我的愿望? 非常感谢

0 个答案:

没有答案
相关问题