Z
Z
zlodiak2021-07-04 13:04:08
Angular
zlodiak, 2021-07-04 13:04:08

How to split routing into modules?

There is an example superhero app on the web from the angular team. In it, AppModule and HeroesModule have a common routing.
I tried to write a similar application. In my version, AppModule and PagesModule have common routing. Everything is done by analogy, but my version does not work. This is expressed in the fact that when the user goes to the page
/page1
, he gets to the Page not found 404 page . That is, fallback is triggered.

Please help me fix my version so that when I go to /page1, the Page1Component component is displayed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lssssssssssl, 2021-07-04
@zlodiak

It will work like this https://stackblitz.com/edit/angular-ivy-fz6fbx?fil...
Just because of the '**', it doesn't get to the child module's routes. Now 404 will only be thrown when all available paths have been checked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question