Angular2多个路由器插座

时间:2017-01-19 03:11:56

标签: angular angular2-routing

我的申请存在问题。我需要该层次结构(请参阅层次结构图片链接)并在DashboardComponent下显示我的SettingsComponents:

Hierarchy picture

这是我的plnkr

我试着用:

命名我的路由器插座

<router-outlet name="dashboard"></router-outlet>

并更改routerLink,但他无法正常工作。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

此处为解决方案plunker:https://plnkr.co/edit/moMbEuKRhkY8mf8kzExX?p=preview

{path: '', component: DashboardComponent, 
    children: [
            {
                path:'settings', loadChildren: 'app/dashboard/settings/settings.module#SettingsModule' 
            }
    ]
}

在DashboardRouting上犯了一个错误,我必须将SettingsComponent声明为子项。

相关问题