有没有人知道如何使用@ angular / router使用otherdashboard和otherdashboardsidebar outlet。这是我的路线。我想使用分层或嵌套路由,以便可以使用breadcrumbing。
export const routes: Routes = [{ path: '', redirectTo: 'login', pathMatch: 'full' },
{ path: 'login', component: LoginComponent },
{ path: 'dashboard', component: MainComponent, data:{displayName:'My App Name'},
children: [
{ path: 'mainDashboard', component: HomeComponent, outlet: 'content', data:{displayName:'First Dashboard'},
children:[
{ path: 'otherdashboardsidebar', component: OtherDashboardSidebarComponent, outlet: 'sidebars' },
{ path: 'otherdashboard', component: OtherDashboardComponent, outlet: 'contents',data:{displayName:'Second Dashboard'} }
]},
]
}
];
当我使用
时this.router.navigate(['/maindashboard',{outlets: {'content': ['otherdashboard'], 'sidebar': ['otherdashboardsidebar']}}]);
我得到错误:无法匹配任何路线。网址细分:' maindashboard'