我已经在Angular-6应用中配置了路由。尝试使用基于named router-outlets
的路由。
我似乎已经按照规定/需要完成了所有工作,但是我仍然收到以下错误
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'setuporg'
Error: Cannot match any routes. URL Segment: 'setuporg'
at ApplyRedirects.noMatchError (router.js:1382)
at CatchSubscriber.eval [as selector] (router.js:1363)
路由一致性:
const appRoutes: Routes = [
{
path:'login',
component: IdeComponent,
children:[
{
path: 'setuporg',
component: SetupOrgComponent,
outlet: 'wrkspace'
}]
}
ide.component.html
<button mat-raised-button [routerLink]="[{outlets:{wrkspace:['setuporg']}} ]" routerLinkActive="active">Org</button>
. . . .
<router-outlet name="wrkspace"></router-outlet>
我基本上是想通过单击上述'SetupOrgComponent'
来在名为wrkspace
的路由器出口中渲染组件"Org"-button
请让我知道我是否缺少任何东西。