$state.go('mylocation', {}, {location:'replace'}); ignored by back button.
See original GitHub issueLet’s say I redirects users to a different view if they arrive at a route that is out of sequence:
if($state.previous.name != 'part3'){
$state.go('part1', {}, {location:'replace'});
}
When the user is redirected the back button in the nav bar is still there, but the history API has been updated and the previous state was effectively eliminated already.
Issue Analytics
- State:
- Created 9 years ago
- Comments:28 (2 by maintainers)
Top Results From Across the Web
$state.go('mylocation', {}, {location:'replace'}); ignored ... - GitHub
Hi my problem is that i am in the Login Page when user log in succefully , i redirect to dashboard but when...
Read more >Back button fails after window.location.replace(href)
When using window.location.href you are adding one more state so Page3 will be set to State3 and when you click the back button...
Read more >location.replace() - Web APIs - MDN Web Docs
The replace() method of the Location interface replaces the current resource with the one at the provided URL. The difference from the ...
Read more >Change location settings | Android Developers
When the Task completes, your app can check the location settings by looking at the status code from the LocationSettingsResponse object. To get...
Read more >How do you redirect to another page in Javascript? - Medium
window.location.replace('http://www.example.com') ... window.history.go(-1) ... meaning the user won't get stuck in a never-ending back-button fiasco.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jorgecasar Super hacky but it’s definitely the path of least resistance. Thanks for the tip. The new syntax after beta.14 is:
Hi again, after some interesting reading of the ionic code, specifically the $ionicViewService I found this solution, replace the currentView with the backView, that it’s exactly location replace does:
Enjoy!