How To Get Both Parent And Child Params Data In Angular Router
Here we show you how easy it is to get the Angular 7 activated route params with RxJs combineLatest
. First import combineLatest
operator, combinning observable.
1 |
|
Then , in our component class, we need to add the activatedRoute
service class and subscribe to it.
constructor(private _route: ActivatedRoute){}
Now that we have the activatedRoute
class in _route
Lets combine the route parent and route child observables and subscribe to return the values.
1 2 3 |
|
That's it!. We welcome any suggestions or better way to do this!