Params inheritance strategy with Angular Router
Params inheritance strategy with Angular Router Few weeks ago I discussed about Angular router, how we could make sure our data are loaded before accessing a component. If you aren’t familiar with Angular router, I suggest you have a look at my previous blog post where I introduced the router . The example was loading data from the store (ngrx store) to check if data were loaded. But it would have been difficult if we needed to load data from the route params. Today we will see the problem faced when taking params from the route and how it can be resolve with a newly introduced feature in Angular router since 5.2.x. 1. Getting data from the route params 2. paramsInheritanceStrategy 1. Getting data from the route params To get data from the route params we take can use the ActivatedRouteSnapshot or the .snapshot property of the ActivatedRoute and use the .params property. Suppose that we have a route /test/:myKey , and we navigate to /test/hello , we could do the following: c...