儿童路线没有被击中

时间:2017-12-06 13:22:42

标签: angular angular-router

我的路线有问题,我的孩子永远不会被击中.. 例如,以下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路线(版本浏览组件加载)。

我在这里做错了什么?

0 个答案:

没有答案