I have a link that will be emailed to my users. The link is of the form http://mysite.com/#/somePage?myParam=123.
When this page is accessed I read the value of myParam by accessing $routeParams.myParam in the controller. I send this value as part of a request to the server with the $http service, and if that generates a success response I redirect to http://mysite.com/#/anotherPage.
However, the search parameter remains in the URL, so I'm actually redirected to http://mysite.com/#/anotherPage?myParam=123. And if I continue to navigate my site the search parameter remains in the URL from this point on.
How can I remove it?
I've tried doing delete $routeParams.myParam before and after the redirect. I've tried doing $location.search('myParam', null) before and after the redirect. None of these works.