Can we have multiple <router-outlet> angular2 +?
If it is possible to have multiple routers, I do not have working code, but I assume that I have a login page for the parent <router-outlet> in the AppComponent . After logging in, I have to show MyHomeComponent in the parent <router-outlet> . Suppose in MyHomeComponent I need a <router-outlet> child element in which I want to display inbox messages, starred messages, starred messages when a user clicks on inbox , outbox and starred links. Please help me find the answer to this question.
AppComponent <router-outlet></router-outlet> ,
Homecompponent
<a routerLink="/xyz">Inbox</a> <a routerLink="/abc">Outbox</a> <router-outlet name='outlet1'></router-outlet> My route routes
{ path: 'login', component: LoginComponent}, { path: '', component: LoginComponent }, { path: 'user', children:[ { path: ':name',children:[ {path:'abc', component: InboxComponent, outlet: 'outlet1' }, {path:'xyz', component: OutboxComponent, outlet:'outlet1' } ] }]}, { path: '**', component: PageNotFoundComponent } +6
1 answer