I was able to use multiple router outlets in angular with this routing
const appRoutes: Routes = [
{ path: '', component: HomeComponent, outlet: 'main' },
{ path: 'product', component: ProductDetailComponent, outlet: 'main' },
{ path: 'chat', component: ChatComponent, outlet: 'chat' }
] ;
and in component html
<button
[routerLink]="['/', {outlets: {'chat': ['chat']}}]">
Chat
</button>
<button
[routerLink]="['/', {outlets: {'main': ['product']}}]">
main
</button>
<router-outlet name="main"></router-outlet>
<router-outlet name="chat"></router-outlet>
export const AppRouting = RouterModule.forRoot(appRoutes);
and it works perfectly fine as you can see in this plunker
https://plnkr.co/edit/r8Vb9zktJblD2nNUXiBz?p=preview
However, the url for these routes are like
localhost:4200/(chat:chat//main:product)
which seems dirty and i feel not good to use in a real website
Is there anyway to clean this url in any way so it does look like a normal url and still make use of multiple router outlets? If not is it fine to use this kind of urls on a real website?