this route table resides inside the SomeRootComponent1-routing.module
in this case If we use routerLink Angular does not reopen the whole page during the navigation to children pages
2) When we use a kind of Dependency injection - all routes we store in children Components and root component knows about them almost nothing (well, it imports their modules, but it is by Angular design)
An example above after applying of DI technique:
in children, we have to add routing modules, for example to SomeChildComponent1:
I think an idea is clear. It works perfect, the only problem - Angular reloads the whole page during a navigation. In fact routes in approach 1) and 2) the same, so would be better to not reload the page. As far as I understand it occurs because routes do not have optimisation after creation and for Angular they are dedicated route array members and therefore it reloads the page.
There are two (at least) possible ways of how to make routing between some page and its sub-components rendered after the router-outlet tag:
1) Common. Route table in root module:
this route table resides inside the SomeRootComponent1-routing.module
in this case If we use routerLink Angular does not reopen the whole page during the navigation to children pages
2) When we use a kind of Dependency injection - all routes we store in children Components and root component knows about them almost nothing (well, it imports their modules, but it is by Angular design)
An example above after applying of DI technique:
in children, we have to add routing modules, for example to SomeChildComponent1:
I think an idea is clear. It works perfect, the only problem - Angular reloads the whole page during a navigation. In fact routes in approach 1) and 2) the same, so would be better to not reload the page. As far as I understand it occurs because routes do not have optimisation after creation and for Angular they are dedicated route array members and therefore it reloads the page.