0
我希望如果用戶登錄,他不能通過硬件後退按鈕進入登錄和OTP頁面。當用戶使用離子登錄時停止用戶登錄頁面
.controller('viewoemCtrl', function($rootScope,$scope,$http,$ionicPopup,$state,$ionicHistory,$ionicLoading,productService,$ionicPlatform) {
$scope.user = {}; //declares the object user
$ionicPlatform.onHardwareBackButton(function() {
if (true) { // your check here
$ionicPopup.confirm({
title: 'Exit from App!',
template: 'are you sure you want to exit?'
}).then(function (res) {
if (res) {
navigator.app.exitApp();
}
})
}
})
})
的任何情況下,你談論的註銷功能硬件後退按鈕funtionality ? –
不,我正在採取後退按鈕功能只有不註銷功能。 –
你可以通過這個:https://stackoverflow.com/questions/30916966/how-to-skip-login-page-if-user-is-already-logged-in-ionic-framework –