I have a problem with the back button, I initially thought that the problem was in the cordova, but I identified that the problem is actually in the ionic, looking on the internet I found the following code:
// Disable BACK button on home
$ionicPlatform.registerBackButtonAction(function (event) {
if($state.current.name=="app.home"){
navigator.app.exitApp();
}
else {
navigator.app.backHistory();
}
}, 100);
But it is giving the following error:
Uncaught ReferenceError: $ ionicPlatform is not defined
I'm putting this code inside a new document called functionAngular.js and adding it to the end of body
. How do I report this function?
My problem:
I'm wanting the back button of
aparelho móvel
not to exit the application on screens other than the home screen. The problem is that instead of doing this, it closes the application.
Thank you in advance for the help.