Reputation: 327
hello i am trying to add some string parameters to the navigation url like this
this.router.navigate(['/merchant/setpassword?acc='+response.infoCode]);
but when i am using this is redirecting me to
/merchant/setpassword%3Facc%3DeyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJtZXppYW4iLCJjb3VudHJ5IjoiOTYiLCJjcmVhdGVkIjoxNTAwMzExODk2MDQ5LC
My problem lies in %3Facc%D i want this to become ?acc=
Upvotes: 2
Views: 1856
Reputation: 1902
Try this,
this.router.navigate( [
'url', { id: 'companyId', param1: 'value1'
}]);
Check, How to handle query parameters in angular 2
Upvotes: 3