Thursday, 26 December 2019

angular importing module that has routes but without the routes

In angular (8),  importing a module that has routes has the consequence of the routes being merged which can the undesirable behaviour of having the matching component of the imported module displayed instead of the component of the importing module.
To fix this, you need to split the imported module into 2 modules: the first one  with everything except the routes and the other one importing the first one and adding routes.
Then you can import the module without routes without any problem