Say, I've got a URL with multivalued parameter like:
http://my-domain.com?param1=aaa¶m1=bbb
activatedRoute.snapshot.queryParams will equal to: { param1: ['aaa', 'bbb'] } - an object with both param1 values.
So far so good. Now, I want to modify one of the values. With "normal", single values parameters I do it with
router.navigate(['.'], { queryParams: { param: 'newValue' }}
However, when trying with an array of values:
router.navigate(['.'], { queryParams: { param1: ['aaa', 'ccc'] }}
it doesn't produce ?param1=aaa¶m1=ccc, but ?param1=aaa,ccc instead.
The question is: how can I navigate to ?param1=aaa¶m1=ccc modifying just one of multiple values of a single param?
I hope there is a better option that building the whole URL myself and using router.navigateByUrl...?
Ultimately I can rewrite it to utilize comma-separated param1=aaa,ccc notation, but I'd like to avoid it.
ng version is 2.4.9
Thanks for your suggestions.