I have encountered a small problem.
I developed an app using Angular 6 with children routes implemented like this:
{
path:'pages', component:DatePagesComponent,
children : [
{path:'404', component:Error404Component},
{path:'500', component:Error500Component}
]
}
My html structure looks like this:
<li [routerLinkActive]="['active']"><a [routerLink]="['/pages/404']">404</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/pages/500']">500</a></li>
The issue I am facing is that the components load under DatePagesComponent
even though the URL changes correctly when clicking on either 404 or 500. The content doesn't change accordingly.
I have included
<router-outlet></router-outlet>
in my app.components.html
file, but it's not working as expected.
Could you please help me identify the problem and provide a solution?