I think there does not exist any method to achieve this. I solved it by forcing the browser to #loc2 from #loc1. From #loc2 I forced it to #loc3, so that the back button takes it back to #loc2.
Angularjs - force the browser to return to a different location via "back button"
-
15-06-2023 - |
Question
I am on #loc1. On button click I want to go to #loc3 from #loc1, in such a way that doing back from #loc3 should take me to #loc2. Is that possible in Angularjs?
Thanks in advance.
Solution 2
OTHER TIPS
You can force to go backward without taking in consideration .back() state.
Example:(set for each location to go backward with 1 route)
$location.path('/yourLocation').replace();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow