我正在使用以下html代碼段。默認情況下使第一個選項卡處於活動狀態
1.)我如何使默認的常規選項卡激活。我試圖添加活躍的課程,但不知何故,第一個活動課程每次都是活躍的。
2.)一旦我點擊標籤,如果我重新加載頁面,我得到以下錯誤,整個頁面似乎打破。網址回落到基本URL
EXCEPTION: Uncaught (in promise): Error: Cannot find primary outlet to load 'DataConfigurationGeneralDetailComponent'
Error: Cannot find primary outlet to load 'DataConfigurationGeneralDetailComponent'
HTML
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item"><a class="nav-link"
data-toggle="tab"
[routerLink]="['general']" [routerLinkActive]="['active']"
role="tab" dpTranslate="dataconfiguration.tabs.general">General</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab"
[routerLink]="['mapping']" [routerLinkActive]="['active']"
dpTranslate="dataconfiguration.tabs.mappings">Mappings</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab"
[routerLink]="['target']" [routerLinkActive]="['active']"
dpTranslate="dataconfiguration.tabs.target">Target</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<router-outlet></router-outlet>
</div>
ROUTES
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'
},
},
{
path: ':id/dataconfiguration/:id',
component: DataConfigurationDetailComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'dataconfiguration.home.title'
},
children: [
{
path: 'general',
component: DataConfigurationGeneralDetailComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'dataconfiguration.home.title'
}
},
{
path: 'mapping',
component: DataConfigurationMappingDetailComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'dataconfiguration.home.title'
}
},
{
path: 'target',
component: DataConfigurationTargetDetailComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'dataconfiguration.home.title'
}
}
]
}
]
}
];
我也放了路由表。我應該在哪裏把所有的(*) –