如何以角度2附加到现有URL

时间:2017-03-01 12:07:23

标签: angular angular2-routing

所以我的路线配置如下所示

export const tenantRoute: Route[] = [
    {
        path: 'tenant',
        component: TenantComponent,
        data: {
            authorities: ['ROLE_USER'],
            pageTitle: 'tenant.home.title'
        },
        children: [
            {
                path: ':id',
                component: TenantDetailComponent,
                data: {
                    authorities: ['ROLE_USER'],
                    pageTitle: 'tenant.home.title'
                },
                children: [
                    {
                        path: 'dataconfiguration/:id',
                        component: DataConfigurationDetailComponent,
                        data: {
                            authorities: ['ROLE_USER'],
                            pageTitle: 'dataconfiguration.home.title'
                        }
                    }
                ]
            }
        ]
    }
];

所以,一旦我到了[routerLink]="['../tenant', tenant.id ]

现在我的routerLink应该是DataConfigurationDetailComponent

的样子

1 个答案:

答案 0 :(得分:1)

试试这个:

[routerLink]="['../tenant', tenant.id, 'dataconfiguration', id ]