I have set up the following routing system
export const MyRoutes: Routes = [
{path: \'\', redirectTo
An alternative (on Angular 7+) is to subscribe to the ActivatedRoute url observable and use "withLatestFrom" to get the latest paramsMap and queryParamsMap. It appears that the params are set before the url observable emits:
this.route.url.pipe(
withLatestFrom(this.route.paramMap, this.route.queryParamMap)
).subscribe(([url, paramMap, queryParamMap]) => {
// Do something with url, paramsMap and queryParamsMap
});
https://rxjs-dev.firebaseapp.com/api/operators/withLatestFrom
https://angular.io/api/router/ActivatedRoute