I am getting the following error after configuring child routes.
Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'parent/child1
app.routing.ts
{ path: 'home', component: homeComponent},
{ path: 'about', component: aboutComponent},
{ path: 'parent', component: parentComponent,
children:[
{
path: '',
redirectTo: '/parent/child1',
pathMatch: 'full'
},
{
path: 'child1',
component: child1Component,
outlet: 'subRouter'
},
{
path: 'child2',
component: child2Component,
outlet: 'subRouter'
}]
},
{ path: '**', redirectTo: 'home', pathMatch: 'full' }
In my index.html, I have <router-outlet></router-outlet>
In my parent.htm(parentComponent) I have <router-outlet name="subRouter"></router-outlet>
What am i missing? Why i am getting that error? How can i resolve this error?