Ui-sref disable back button


#1

Is there a way to disable the back button on the destination page after clicking a button with ui-sref heading to the destination page?


#2

Have you tried to clear the history when entering destination page?


#3

No… How do I do that?


#4

Either you do it in your destination controller but you got to make sure your controller is reloaded each time you go to this view (try to put cache: false in your state) or you do it in the resolve property of your state.

For the history part, search the forum.


#5

use ng-click on the button instead of ui-sref
in the click function use $ionicHistory.nextViewOptions()-function to hide back-button on the next view.
http://ionicframework.com/docs/api/service/$ionicHistory/

After that redirect with $state.go().