i'd like to control the event of "press hardware back button" in ionic framework. This is my code. Why does not it work? thank you
.run(function ($ionicPlatform) {
$ionicPlatform.ready(function () {
if (window.StatusBar) {
StatusBar.styleDefault();
}
$ionicPlatform.registerBackButtonAction(function (event) {
event.preventDefault();
event.stopPropagation();
alert("Stop");
}, 100);
});
})
i also try the other solution:
.run(function ($ionicPlatform) {
$ionicPlatform.ready(function () {
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
$ionicPlatform.registerBackButtonAction(function (event) {
event.preventDefault();
event.stopPropagation();
alert("Stop");
}, 100);
})
but it still doesn't work
thank you