I'm using Angular 8 and am having trouble trying to get a nested route to work. The error I get is:
core.js:6014 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'product/colours'
I have the AppComponent HTML which loads my child component 'product' without issue.
app.component.html
<router-outlet></router-outlet>
Inside my 'product' component I want to include a nested component called 'colours'.
colours.component.html
<a routerLinkActive="is-active" routerLink="colours">Colours</a>
<router-outlet name="nested"></router-outlet>
I added a new nested route like this:
app-routing.module.ts
{
path: 'product',
component: ProductComponent,
children: [
{
path: 'colours',
component: ColoursComponent,
outlet: 'nested'
}
]
}
Any advice?
/product/coloursotherwise it will match just/colours. - Michelangelo