Reputation: 4421
I want to use id when requesting data but not show it id url.
[routerLink]="['/', category.slug, {id: category.categoryId}]"
This results in url '/cameras;id=3' where id 3 is the cameras category. It works but I would like to have a clean url like '/cameras' only
Upvotes: 1
Views: 409
Reputation: 15261
Parameters are encoded in url (you can even customize this encoding), but it is not possible to hide them, hiding in this case === completely removing.
You may use workaround using shared service and pass parameters using this service when navigating within application, but in this case you will not be able to share links, because it will not contain parameter value.
Upvotes: 1