I want to display different views by child routes. For Example I want my template to hold multiple router-outlet
Version: @angular/router": "3.0.0-alpha.7"
<router-outlet></router-outlet>
<router-outlet name="route1"></router-outlet>
<router-outlet name="route2"></router-outlet>
In my router i want to specify the name of router.
As i saw in a question, the solution for this is to specify AuxRoute, but AuxRoute does not exist in this version.
{path: '/', component: HomeComponent, as: 'Home'},
new AuxRoute({path: '/route1', component: Route1Component, as: 'Route1'}),
new AuxRoute({path: '/route2', component: Route2Component, as: 'Route2'})
While on angular 2 official website i found that it is possible to have multiple router, but i can't find any resource.
https://angular.io/docs/ts/latest/guide/router.html
A template may hold exactly one unnamed <router-outlet>. The router supports multiple named outlets, a feature we'll cover in future.
Current version multiple-named
router-outlet
(for angular2 RC.6^) looks like this:Router configuration
Template within Home component:
And a navigation example from root component:
Alternative way:
Here's live Plunker Example
See also