title: How to disable hardware button for Particular page in Ionic
body: <p>I have written <code>$ionicPlatform.registerBackButtonAction</code> for all states in <code>app.run()</code>.So when app intialize it register back button for all pages .Now i want to change the hardware back button functionality for particular page in the controller of that page .How can i do that without registering all other pages again.</p>
  
  <pre><code> $ionicPlatform.registerBackButtonAction(function() {
          if ($state.current.name == 'app.homepage' || $state.current.name == 'app.loginUser') {
              navigator.app.exitApp();
          } else if ($state.current.name == "app.contacts" || $state.current.name == 'app.carDocuments' || $state.current.name == 'app.tracking' || $state.current.name == 'app.logBook'|| $state.current.name == 'app.geofence' || $state.current.name == 'app.walktocar' || $state.current.name == 'app.dashboard' || $state.current.name == 'app.geofenceTest' || $state.current.name == 'app.settings' || $state.current.name == 'app.about' || $state.current.name == 'app.tripDetail' ||      $state.current.name == 'app.newTripDetail'|| $state.current.name == 'app.followMeTrack' || $state.current.name == 'app.followMe' || $state.current.name == 'app.maintainance' || $state.current.name == 'app.faultHistory' || $state.current.name == 'app.routeType'|| $state.current.name == 'app.poi') {
              if ($rootScope.isDeletePage == "true") {
                  $rootScope.$broadcast('callOriginalView');
                  $rootScope.isDeletePage = "false";
              } else {
                  $ionicHistory.nextViewOptions({
                      disableBack: true
                  });
  
                  $state.go('app.homepage');
              }
  
          } else {
              $ionicHistory.goBack();
          }
      }, 100);
  </code></pre>
  
  <p>So if i write $ionicPlatform.registerBackButtonAction again then i have to write all this code again to register. How  i can override the back button for particular page only ih his controller</p>