doonot doonot - 2 months ago 16
AngularJS Question

Navigate back to the main screen without showing a back button in Ionic

I am creating an Ionic application. After the user uploads an image, I want to send them back to the main screen and refresh the data that is shown.

Whenever I use

$state.go("app.home")
or
location.href = "#/app/home"
, a Back button is shown to the user. I do not want this behavior because the user is now back on the main screen and there should not be any back button in the nav-bar.

Any idea how I can achieve this?

Answer

I found an answer for my problem:

$ionicHistory.nextViewOptions({
  disableBack: true
});

$state.go("app.home");