【发布时间】:2021-05-14 11:43:52
【问题描述】:
我想知道如何以角度访问杠杆两条父路线。例如:如果我使用以下路由,如何在 AttributeListComponent 中获取 componentId:
const routes: Routes = [
{path: '', redirectTo: '/components', pathMatch: 'full'},
{path: 'components', component: SideNavComponent,
children: [
{path: ':componentId', component: ComponentTabComponent, children: [
{path: '', redirectTo: 'entities', pathMatch: 'full'},
{path: 'entities', component: EntityListComponent, children: [
{path: ':entityId', component: EntityTabComponent,
children: [
{path: '', redirectTo: 'attributes', pathMatch: 'full'},
{path: 'attributes', component: AttributeListComponent},
{path: 'tasks', component: TaskListComponent}
]}
]},
{path: 'domains', component: DomainListComponent}
]},
]},
{ path: '**', component: PageNotFoundComponent }
];
【问题讨论】:
-
举例说明你如何/为什么要使用这个想法。
标签: html css json angular typescript