我有这条路线/customers
应该处理孩子。
{
path: '/customers/...',
name: 'CustomerList',
component: CustomersComponent,
useAsDefault: true
}
CustomersComponent
@Component({
template: `
<div class="col-lg-4">
<router-outlet></router-outlet>
</div>
`,
directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
{ path: '/', component: CustomerListComponent, name: 'CustomerList', useAsDefault: true },
{ path: '/:id', component: CustomerDetailComponent, name: 'CustomerDetail' }
])
export class CustomersComponent {
}
如何映射我的路线,以便我可以在左侧显示我的列表,并在将网址从/customers
更改为/customers/1
时选择项目将在右侧打开?
目前正在发生的事情是选择一个客户将在一个全新的页面中打开。我假设这是由我的CustomersComponent
只有1 router-outlet
引起的,CustomerListComponent
或CustomerDetailComponent
。