Reputation: 3801
I have an object:
let paramsObj = {
mode: "resetPassword",
oobCode: "dsaSdsxSFXx",
apiKey: "OQPzWYkFNe",
lang: "en"
}
I want to use this object as queryParams for router navigate:
this.router.navigate(['/action', { queryParams: paramsObj}]);
But this is doesn't work. What is the correct way to do this?
Upvotes: 0
Views: 58
Reputation: 3801
My bad, I wrote this.router.navigate(['/action', { queryParams: paramsObj}]);
,
but this is should be this.router.navigate(['/action'], { queryParams: paramsObj});
, and then it work as expected.
Upvotes: 1