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