angularjs - Hide nav-button depending on the current state change -
how can hide/show button based on current view? <ion-nav-buttons side="right"> <button id="search_button" class="button button-icon ion-ios-search button-clear" ng-click="search()"> </button> </ion-nav-buttons> if have parent controller containing views can following : .controller("parentcontroller", function($scope){ var self = this; $scope.$on('$statechangesuccess', function(event, tostate, toparams, fromstate, fromparams){ self.showbutton = (tostate.name == "yourstatename"); }); }); html : <div ng-controller="parentcontroller parentctrl"> <ui-view> </ui-view> <ion-nav-buttons side="right"> <button id="search_button" class="button button-icon ion-ios-search button-clear" ng-click="search()" ng-if="parentctrl.showbutton"> </button...