2017-01-19 98 views
1

我的應用程序出現問題。我需要一個層級(見分層圖像鏈接),下DashboardComponent顯示我SettingsComponents:Angular2多個路由器插座

Hierarchy picture

這裏我plnkr

我想的名字我的路由器出口有:

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

並更改routerLink但他不工作。

感謝您的幫助。

+0

你能描述一下你面對的問題嗎? – ani5ha

+0

@ ani5ha在儀表板上,我需要在「需要組件在這裏:」鏈接內容下顯示。 (當我點擊設置配置文件鏈接 - > SettingsComponent視圖必須顯示在需要組件在這裏:「)非常感謝。 – Spawnrad

+0

找到了解決方案:https://plnkr.co/edit/moMbEuKRhkY8mf8kzExX?p=preview – Spawnrad

回答

0

這裏的解決方案plunker:https://plnkr.co/edit/moMbEuKRhkY8mf8kzExX?p=preview

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

已經對DashboardRouting一個錯誤,我必須聲明SettingsComponent兒童。

相關問題