Angular 2 - Submodule routing and nested

后端 未结 3 1762
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 08:46

I\'m looking for a solution with Angular 2 for the scenario explained below:

In this scenario, the top-nav contains links to load submodules and sub-nav has

3条回答
  •  难免孤独
    2020-12-07 09:42

    you have to mention the outlet name in the routes mention your router outlet name in the routing like this "outlet:'sub"

    routes: Routes = [
      {path:'', redirectTo: 'login', pathMatch: 'full'},
      {
        path: 'login',
        component: LoginComponent,
    
      },
      { path: 'home',
        component: AppComponent,
          children: [
            {path: 'home/pdf',component: SideMenuPage,outlet:"sub" },
            {path:'home/addFileUp',component:SidePageAdd,outlet:"sub"},
          ]
       },
    ];
    

提交回复
热议问题