如果您仅使用Javascript,则可以通过以下链接检查如何禁用“后退按钮”:
http://jordanhollinger.com/2012/06/08/disable-the-back-button-using-
html5/
但是上面的代码不适用于AngularJS,因为AngularJS在后台使用URL_Hash#,所以在这里我将展示如何转身:
在您的主要Javascript代码中(不在AngularJS代码或控件中),输入以下代码:
// *** Author: Wael Sidawi// **** Deactive Back Button **** var history_api = typeof history.pushState !== 'undefined';// history.pushState must be called out side of AngularJS Codeif ( history_api ) history.pushState(null, '', '#StayHere'); // After the # you should write something, do not leave it empty
现在,在您的AngularJS Controler中放入以下事件列表器:
$scope.$on('$locationChangeStart', function(event, next, current){ // Here you can take the control and call your own functions: alert('Sorry ! Back Button is disabled'); // Prevent the browser default action (Going back): event.preventDefault(); });希望对您有所帮助。



