【发布时间】:2017-12-09 14:57:52
【问题描述】:
存在关于在 Ionic 中覆盖物理 Android BACK 按钮以提供自定义行为的问题:
- Ionic override all BACK button behaviour for specific controller
- Ionic: How to override back button function?
但是如何取消覆盖以恢复默认行为?
我尝试更改处理程序的优先级,希望默认处理程序可能具有更高的优先级。
var customBackButton = function() {
console.log("this is custom behaviour");
};
$ionicPlatform.registerBackButtonAction(
customBackButton, 101
);
$scope.$on('$destroy', function() {
$ionicPlatform.registerBackButtonAction(
customBackButton, 0
);
});
这不起作用。
【问题讨论】:
标签: ionic-framework ionic