Here are the steps to play:
- Create the base ion project "ion test sidemenu launch"
- Add the platform of the android platform "ionic platform add android"
In app.js add the code:
$ionicPlatform.registerBackButtonAction(function (event) { alert("back button action handler"); event.preventDefault(); }, 999);
This code can be added in the .run method or in the $ ionicPlatform.ready () method - the same result does not work
- "ionic build android", then "ionic upload" → or manually, put apk on the device
[BUG] - the warning is not displayed, and viewing the navigation through the history is performed. This, how this action that I am trying to register, is not taken into account.
What am I doing wrong? I also tried this code in the controller, also e.stopPropagation () or e.stopImmediatePropagation still failed.
I have the latest Ionic (1.4.5) and Cordova 4.3.0 tested on some Samsung devices. Ripple is working fine.
android ionic-framework ionic
gmodrogan
source share