I am trying to figure out how to implement a url in a format for example locations/details/1001. Instead i keep getting a format like this locations/details?id=1001, which my routing does not like.
Here is the code i am using for this:
this.router.navigate(['/location/details'], { queryParams: { id: locationId } });
and in my routing module:
{ path: "locations/details/:id", component: LocationDetailsComponent, canActivate: [AuthGuard] }
CodePudding user response:
this.router.navigate(['/location/details/', id])