YEO*_*JIN 2 javascript jquery angularjs


我想禁用浏览器后退按钮和刷新按钮。有角度的
例如我的来源
页面来源:
"use strict";
.controller("wizardSecondController", function($scope, $state, $stateParams, wizardManager) {
$scope.$on("$viewContentLoaded", function(event, data) {
});
Run Code Online (Sandbox Code Playgroud)
我想阻止浏览器返回并刷新。请回答 。
小智 6
如果您想在 angular 中禁用浏览器后退按钮,请尝试以下代码。它可能会有所帮助。
$scope.$on('$locationChangeStart', function(event, next, current){
event.preventDefault();
});
Run Code Online (Sandbox Code Playgroud)