I am currently trying to dynamically generate paths in my app based on server side data. I currently have issues with implementing a second level of child paths. My current app router looks like this:
*basePath*/admin/users
/roles
/groups
When i try to add dynamically child routes to users for exemple, nothing happens when i click on the routerLink directive. The main paths look like this:
[{path:'admin',component:HomeComponent,children:[
{path:'groups',component:GroupsComponent},
{path:'users',component:UsersComponent},
{path:'roles',component:RolesComponent}
]}]
If i try to add children to the users path for example, for some reason nothing happens when i try to click the routerlink inside the UsersComponent. Not even an error. This is what my router looks like when i try to add the users child paths:
[{path:'admin',component:HomeComponent,children:[
{path:'groups',component:GroupsComponent},
{path:'users',component:UsersComponent,children:[
{path:'det',component:UserDetailsComponent},
{path:'userroles',component:UserRolesComponent},
{path:'usergroups',component:UserGroupsComponent},
]},
{path:'roles',component:RolesComponent}
]}]
The 3 main routes groups, users and roles are working fine. When i attempt to click a routerlink inside the UsersComponent to send me to load me one of his children, nothing happens. No error, no url change, no component loading. The UserComponent routerlink elements look like this:
<paper-tabs [selected]="selectedTab" *ngIf = "insideDetails" scrollable>
<paper-tab routerLink="det">USER DETAILS</paper-tab>
<paper-tab routerLink="usergroups">GROUPS</paper-tab>
<paper-tab routerLink="userroles">ROLES</paper-tab>
</paper-tabs>
Am i doing something wrong? PS: The first 3 main paths load in the main module, i am attempting to do the reset in a child module if it holds any importance. PSS: When i initially use resetconfig for the first 3 paths, i save the config array in a variable in the service. I then load that variable in the service in charge of the reset in my child module and i manually add the Users Child paths.
Please let me know if there is anything else i should add, if i am doing something wrong or if i made a mistake.