With Angular 2, is it any way to have sub route not displaying into the main tag
<router-outlet></router-outlet>
For example :
url : "http://mywebsite.com/"
MainComponent.ts
@Component({
...
template:'<router-outlet></router-outlet>'
...
})
@RouteCongif([
{path: '/products', name:'Product', component: Product}
])
This displays the sub component into the <router-outlet> tag
All right, now is it possible to have this kind of configuration :
url : "http://mywebsite.com/products"
ProductComponent.ts
@Component({
template: `
...
<div> My list of products ! </div>
...
<a [RouteLink]="['ProductDetails', {slug-product-details:product.slug}]">
{{ product.name }} Details
</a>
...
<sub-router-outlet></sub-router-outlet>
`
})
@RouteConfig([
{path: '/:slug-product-details', name:'ProductDetails', component: ProductDetailsComponent},
])
And
url : "http://mywebsite.com/products/one-product-details"
ProductDetailsComponent.ts
@Component({
...
template : `
<div> Details of the product : </div>
...
`
...
})
I want to keep the usage of the router with the auto designed url and diplay the route and the details template into this sort of <sub-router-outlet> tag.
Thank you for your help.