2017-03-08 146 views
0

我有一個名爲SMS的子組件的儀表板組件。現在,SMS組件也有它的路由列表。我如何路由在儀表板組件下的sms導航欄下。當我在短信欄下路由時,短信的導航欄不應該消失。以下是截圖。 在我的代碼中,當我點擊quicksms時,它將我路由到quicksms頁面,導航欄消失。路由下的路由 - 角2

+2

見http://stackoverflow.com/questions/39112891/angular-2-rc5-router-outlet-inside-another-router-outlet –

回答

1

有沒有必要的短信路線。這應該工作得很好!

儀表盤路線

export const DashboardRoutes: Routes =[ 

    { 
    path: 'dashboard', 

    component: DashboardComponent, 
    children: [ 

     {path:'messages', component: MessageComponent,canActivate: [AuthGuard] 

    children:[ 
       { 
        path:'transactional', component:quickSmsComponent 
       } 



     ] 


}, 


    ] 

    } 
];