I have a url of this form
http://localhost:8100/my-child/2
When when i click a button i am getting result as
http://localhost:8100/my-child/2/5
How to adjust the url to fit to this form as
http://localhost:8100/my-child/5
This is my code snippet
this.href = this.router.url;
console.log(this.router.url);
this.router.navigateByUrl(this.router.url+id);
Can you please tell me how to adjust the code to get the required output.
2and5are both ids ofmy-child, you must have you route defined for when you entermy-child/2. Use the same route, pass different param