我正在开发基于登录的应用程序。所以如果我从登录页面应用程序按下后退按钮必须退出
app.run(function($ionicPlatform, $state){
$ionicPlatform.registerBackButtonAction(function (event) {
if ( ($state.$current.name=="app.login") ||
($state.$current.name=="app.discussions")
){
// H/W BACK button is disabled for these states (these views)
// Do not go to the previous state (or view) for these states.
// Do nothing here to disable H/W back button.
} else {
// For all other states, the H/W BACK button is enabled
navigator.app.backHistory();
}
}, 100);
})
现在我正在使用这段代码,但如果点击一次后退按钮就会触发。