Angular 角度4 routerlink子路由出口错误。请解释一下';发生什么事了
我的代码如下: 应用程序组件html component.html:Angular 角度4 routerlink子路由出口错误。请解释一下';发生什么事了,angular,angular-routing,Angular,Angular Routing,我的代码如下: 应用程序组件html component.html: 我 接受并理解 书籍详情 app.component.html: 错误是: 错误:未捕获(承诺中):错误:无法匹配任何路由。URL段:“注册” 几个月前,我有一个类似的bug,并在github()上报告了它。不幸的是,这件事到现在还没有解决 我必须将辅助路线的路线设置为单独路线,而不是子路线。在浏览器中检查时,链接显示了什么?我猜它显示了/register/register,所以路由器在register组件中查找reg
我
接受并理解
书籍详情
app.component.html:
错误是:
错误:未捕获(承诺中):错误:无法匹配任何路由。URL段:“注册”
几个月前,我有一个类似的bug,并在github()上报告了它。不幸的是,这件事到现在还没有解决
我必须将辅助路线的路线设置为单独路线,而不是子路线。在浏览器中检查时,链接显示了什么?我猜它显示了/register/register,所以路由器在register组件中查找register中的子项。这里也有一个类似的问题被询问/回答:
<app-header ></app-header>
<router-outlet></router-outlet>
<app-footer></app-footer>
const routes: Routes = [
{ path: 'register', component: RegisterComponent,
children: [
{
path: 'page/:slug',component: PagesComponent,
outlet: 'bookLists'
},
]},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
<label for="CustomerAcceptTerms" class=" control-label emaillabel">
<input type="checkbox" name="terms" value="1"id="CustomerAcceptTerms"> I
accept and understand the
<a [routerLink]="['/register',{ outlets: { bookLists: ['page/terms-and-conditions'] } }]" routerLinkActive="active">Book Details</a>
</label>
<app-details></app-details>
<router-outlet></router-outlet>
<router-outlet name="bookLists"></router-outlet>