0
Well I’m having trouble with the back button, initially I thought the problem was in Ordova, but I identified that the problem is actually in 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 the following mistake is being made:
Uncaught Referenceerror: $ionicPlatform is not defined
I am placing this code inside a new document called functionAngular.js and add it at the end of the body
. How should I inform this function ?
My problem:
I’m wanting the button to come back from
aparelho móvel
does not exit the application on other screens than the home screen. The problem that is giving that instead of doing this, it closes the application.
Thanks in advance for the help.
Have you tried to define the
$ionicPlatform
?– DiegoAugusto
Define where ?
– Renan Rodrigues
I tried to log in the normal way. However registerBaclButtonAction is not visible.
– Renan Rodrigues
Example:
.run(function($ionicPlatform, $ionicPopup) {..
– DiegoAugusto