我的路线有问题,我的孩子永远不会被击中.. 例如,以下url routes数组:
const APP_ROUTES: Routes = [
{ path: '', redirectTo: '/apps', pathMatch: 'full'},
{ path: 'auth', component: AuthenticationComponent },
{ path: 'apps', component: ApplicationbrowserComponent},
{ path: 'apps/:id', component: VersionbrowsingComponent,
children: [
{path: '', component: AuthenticationComponent, pathMatch: 'full'},
{path: 'versions', component: AuthenticationComponent},
{path: 'versions/:id', component: AuthenticationComponent}
]
},
{ path: '**', component: PagenotfoundComponent}
];
apps/:id
的孩子永远不会被击中,只有父母似乎。例如,如果我要将其输入url:
mysite/app/myapp
我会(正如预期的那样)点击' apps /:id'路由。
但如果我说:
mysite/app/myapp/versions
我从未接触到孩子,它最终在apps/:id
路线(版本浏览组件加载)。
我在这里做错了什么?