Is there a way to clear out the nav-router history and prevent a back button?

After picking through the IonicNavRouter code, I’ve tried many ways to hide the back button on various pages. Examples :

  • hide-back-button="true"
  • $scope.showBackButton = false;
  • `$scope.enableBackButton = false;
  • $scope.hideBackButton = true;

None of these have worked for me. For now, I’ve come up with a really ugly hack. I put this on each controller that should not have a back button. Unfortunately, it creates a short delay where the back button is show for a second. It also requires $rootScope and $timeout on each of these controllers. It’s the best I can do for now:

$timeout( function() {
    $rootScope.stackCursorPosition = 0;
}, 0);

Is there a better way to be doing this?

1 Like