Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

angular child routes not working

When you use children inside of your routes the parent component needs to have <router-outlet></router-outlet> inside it's html in order for the children to be loaded inside that parent. Angular Docs on Child Configuration

Additionally, with routed components it is not necessary to add the component selector inside the html of the parent component as they will be injected automatically by the router below your router-outlet.

<router-outlet></router-outlet>

more infos https://angular.io/guide/router#child-route-configuration
 
PREVIOUS NEXT
Tagged: #angular #child #routes #working
ADD COMMENT
Topic
Name
1+2 =