I want to use $location to change url search parameter. For example:
I have a url, example.com/path?id=12345&target=_self
how could I use $location to change the url to
example.com/path?id=54321&target=_blank
When I use $location.search({id: '54321', target='_blank'}), it just append a
new parameter to the end of url instead of change the url.
Thanks.