ログインベースのアプリケーションに取り組んでいます。したがって、ログインページから戻るボタンを押すと、アプリを終了する必要があります
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);
})
現在、このコードを使用していますが、戻るボタンを 1 回押すとトリガーされます。