0

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.

1 Answer 1

1

The solution turned out to be to upgrade from Angular 1.0.5 to 1.0.6, as it was a bug in Angular.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.