Hi,
I have a problem with registerBackButtonAction in my app,
i have slide menu and tabs for example my state is : menu.tabs.home ,
menu.tabs.favorite
and i have som page without menu and tab for example my states is : aboutUs ,
setting, setting.language
i call my code about back button in .run in app.js
my problem is:
in tabs back button works fine and without bug but when i change state to for
example aboutUs or setting.language back button some time works fine and some
time not work !!!
i am so confused:( can you help me? where is my mistake?
my codes in run for back button is:
myApp.run(function($ionicPlatform, $state) {
$ionicPlatform.ready(function() {
$ionicPlatform.registerBackButtonAction(function (event) {
if($state.current.name=="menu.tabs.home"){
alert("1");
navigator.app.exitApp();
}
else {
alert("2");
navigator.app.backHistory();
}
}, 100);
});
});
Thank you.