Stop back navigation on $ionicPlatform.onHardwareBackButton


#1

Is there a way i can avoid back navigation using$ionicPlatform.onHardwareBackButton

Something like this

$ionicPlatform.onHardwareBackButton(function(e) {
    e.stopPropagation();
      alert('caught');
      $ionicLoading.hide();

  });

e.stopPropagation(); and e.preventDefault(); are not working

i want to avoid $ionicPlatform.registerBackButtonAction

Help is appreciated Thanks !