I am trying to disable the back button on an Android device with a "keyboard: false", but it does not work.
$ionicModal.fromTemplateUrl('templates/login.html', { scope: $scope, keyboard: false })
How to disable it. Thanks.
ionicModal provides option hardwareBackButtonClosefor installation falsefor this behavior.
hardwareBackButtonClose
false
$ionicModal.fromTemplateUrl('templates/login.html', { scope: $scope, hardwareBackButtonClose: false })
See related documentation: http://ionicframework.com/docs/api/controller/ionicModal/
Another option might be: isShown (), as documented in http://ionicframework.com/docs/api/controller/ionicModal/
- (! $scope.modal.isShown()) { navigator.app.exitApp(); } else { // ... }
Check this topic: Disable hardware return button in Ionic app?
This should do it:
$ionicPlatform.registerBackButtonAction(function () { if (condition) { navigator.app.exitApp(); } else { handle back action! } }, 100);
But I would advise against this if you really don't need to. Violation of the expected model of work will damage the whole platform very slightly.
Source: https://habr.com/ru/post/1606601/More articles:SwitchCompat provides null pointer exception in RecyclerView - androidCorrect way to implement CoreBluetooth connectPeripheral timeout? - iosAdding SwitchCompat software error - javaIntelliJ Coverage of application code does not work in editor - javaFind the maximum amount of two sorted arrays - arraysGolang: Как получить общий размер каталога? - goDoes Spring make a call to Cloud Feign inside the hystrix command? - spring-cloudНесколько результатов для каждой отдельной строки (один ко многим) с Pandas - pythonPaging and filter in Yii2 Gridview - filterForce credentials for every click? - gitAll Articles