Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to implement a details view in angular?

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

{ path: "locations/details/:id", component: LocationDetailsComponent, canActivate: [AuthGuard] }

>Solution :

this.router.navigate([‘/location/details/’, id])

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading