I\'m trying to disable the back button on my Cordova app. I\'m using AngularJS + Ionic Framework. I found topics about this and tried the code bellow, but it has absolutely
To prevent App from device back button functionality use,
$ionicPlatform.registerBackButtonAction(function (event) {
event.preventDefault();
}, 100);
If you want to prevent the particular page use,
$ionicPlatform.registerBackButtonAction(function (event) {
event.preventDefault();
if ($location.path() === "/pagename" || $location.path() === "pagename") {
navigator.app.exitApp();
} else {
$ionicHistory.goBack();
}
}, 100);