There's a way to check if back button is shown?


#1

I’m trying to show an icon on header with ion-nav-buttons, but just if back button is hidden with hide-back-button or whatever

What can I do?


#2

You could adapt this to work for you.

$rootScope.$on('$viewHistory.historyChange', function(e, data) {
    if (data.showBack) {
      doSomething();
    }
  });

Hide left header button when showing back button
#3

I found the above code to not work in beta 14 and had to do the following instead (hope this helps out anyone else searching for an answer):

$rootScope.$on('$ionicView.beforeEnter', function (e, data) {        
        if (data.enableBack) {
           doSomething();
        }
    });

[Solved] Detect if ion-nav-button is shown