There are cases where multiple activatedRoute nodes should be associated/handled by the same PageRouterOutlet.
We can gat additional ActivatedRoutes nodes when there is:
Lazy loading - there is an additional ActivatedRoute node for the RouteConfig with the loadChildren setup
Componentless routes - there is an additional ActivatedRoute node for the componentless RouteConfig
Example:
R <-- root
|
feature (lazy module) <-- RouteConfig: { path: "lazy", loadChildren: "./feature/feature.module#FeatureModule" }
|
module (componentless route) <-- RouteConfig: { path: "module", children: [...] } // Note: No 'component'
|
home <-- RouteConfig: { path: "module", component: MyComponent } - this is what we get as activatedRoute param
In these cases we will mark the top-most node (feature). NSRouteReuseStrategy will detach the tree there and
use this ActivateRoute as a kay for caching.
There are cases where multiple activatedRoute nodes should be associated/handled by the same PageRouterOutlet. We can gat additional ActivatedRoutes nodes when there is:
loadChildren
setupExample: R <-- root | feature (lazy module) <-- RouteConfig: { path: "lazy", loadChildren: "./feature/feature.module#FeatureModule" } | module (componentless route) <-- RouteConfig: { path: "module", children: [...] } // Note: No 'component' | home <-- RouteConfig: { path: "module", component: MyComponent } - this is what we get as activatedRoute param
In these cases we will mark the top-most node (feature). NSRouteReuseStrategy will detach the tree there and use this ActivateRoute as a kay for caching.