Angular:访问名为parents的路由器出口的子路径时出错

时间:2019-04-19 09:54:04

标签: angular routes router-outlet

我正在使用Angular 6,并且我想知道当该父级是名为的路由器出口时如何访问子级路径。

因为事情是当我转到路径(此消息下方)时,我可以毫无问题地访问我的页面,但在控制台中写入了一个错误,提示Angular找不到我的路线...

{
    path: 'connect',
    component: ConnectComponent,
    outlet: 'modal',
    canActivate: [AuthenticationGuard, AuthorizationGuard],
    canActivateChild: [AuthenticationGuard, AuthorizationGuard],
    children: [
      {
        path: 'ssp',
        component: SspComponent,}]}

消息打印:

Error: Cannot match any routes. URL Segment: 'connect/ssp'

但是我在页面上没有问题。我正在访问这样的路径:

/(modal:connect/ssp)

有人知道如何解决此消息吗? 谢谢

0 个答案:

没有答案