I have some filters which when they are checked they apply an id to the url under the same queryParam. I'm using router.navigate
method. I can get them to show as a list like so:
http://localhost/view/?opts=1-1 // one filter selected
http://localhost/view/?opts=1-11-2 // two filters selected
However I'd like the URL or specifically the query params' value to be separated by a ampersand '&'. Like so:
http://localhost/view/?opts=1-1&1-2 // two filters selected
Here's my current code:
this._router.navigate([routeUrl], { queryParams: {opts: filterParams}});
I've tried setting filterParams
as an array but that just duplicates the property value. Is there an Angular way to achieve this or will I need to resort back to JS or jQuery?