I have a dynamic BreadCrumb navigation where I need to get the params from URL. To achieve this, I'am executing the following code:
const userId = this.activatedRoute.params
.pipe(skipWhile((params: Params) => Number.isNaN(+params['userId'])));
const getAppUserId = userId.pipe(
switchMap((params: Params) => {
return +params['userId']
? this.myAppService.getApplicationUser(+params['userId'])
: of('')
}))
But it's always empty and I never get the params passed to the Observable. When I use queryParams
, it works fine, but I don't want to go for queryParams
concept.
Any idea where I'am going wrong?