Home > Enterprise >  how to implement a details view in angular?
how to implement a details view in angular?

Time:07-21

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])

  • Related