Check out this demo showcasing 2 outlets (Defined in app.module.ts
):
<router-outlet></router-outlet>
<router-outlet name="b"></router-outlet>
The specified routes are:
const routes: Routes = [
{ path: 'a', component: HelloComponent },
{ path: 'b', outlet: 'b', component: HelloComponent },
];
In addition, there are buttons provided to test the routes (found in app.component.html
).
<button routerLink="a">router link a</button>
<button routerLink="b">router link b</button>
While route a functions properly, clicking on route b results in the following error:
ERROR
Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'b'
Error: Cannot match any routes.
Any insights on resolving this issue?