1

As I know, this is to visit a route and pass param to the url

$location.path('/home').search({key:'value'})

This is to clear every param and url and visit the route, history is keep

$location.search('').path('/home');

How about don't keep the history? Like transactional flow, once the user paid, you don't want to let the user to be able to go back. I know there's history service but I think there's more simpler way to do it. I tried to use valina javascript redirect method but it reloaded the entire page which is inconsisten for my SPA.

1 Answer 1

2

You can call

$location.search('').path('/home').replace();

and it will not create an extra record in the back-history of the browser.

See documentation here.

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

1 Comment

with an extra .replace()?

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.