Angular child route loading parent instead of child component
...
{
path: 'solutions', component: SolutionComponent,
children: [
{ path: 'cog', component: CogComponent }
]
},
...
Since you have declared a component
for the path solutions
hence it is showing SolutionComponent
and it will render CogComponent
in the nested router-outlet
{ path: 'dashboard', component: DashboardComponent },
{
path: 'solutions'
children: [
{ path: 'cog', component: CogComponent },
{ path: '', component: SolutionComponent, pathMatch: 'full'}
]
},
...
The above route should work as you intended.