Skip to content
Advertisement

Angular router with params

I created a router with a parent route that contains an id and child routes. The problem is that when I want to navigate under my child routes with the tabs, I get an error :

Error: Cannot match any routes. URL Segment: ‘tabs/user/1/overview’. Error: Cannot match any routes. URL Segment: ‘tabs/user/1/overview’.

User router :

JavaScript

Overview routing :

JavaScript

export class OverviewModule {}

and one button of my tabs :

JavaScript

Is it because my child routes are attached to a module that has its own router? How can I solve my problem please?

EDIT : I have tried with a Component and by adding my :userId on each road, I can navigate on a road but I get stuck. I guess it goes into sub routing and can’t find the other routes….

thanks

Advertisement

Answer

I think you need to change your router link to

JavaScript

we need to specify the parent path first and then we can add the children path. Let me know if it works.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement