Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS,window.onbeforeunload模拟_Javascript_Angularjs - Fatal编程技术网

Javascript AngularJS,window.onbeforeunload模拟

Javascript AngularJS,window.onbeforeunload模拟,javascript,angularjs,Javascript,Angularjs,window.onbeforeunload的角度模拟是什么 我有一个模态对话框,我需要在卸载之前调用它 $scope.toggleModal = function (modalChoice) { switch (modalChoice) { case 'error': $scope.modalErrorShown = !$scope.modalErrorShown;

window.onbeforeunload的角度模拟是什么 我有一个模态对话框,我需要在卸载之前调用它

$scope.toggleModal = function (modalChoice) {
            switch (modalChoice) {
                case 'error':
                    $scope.modalErrorShown = !$scope.modalErrorShown;
                    break;
                case 'end':
                    $scope.modalEndShown = !$scope.modalEndShown;
                    break;
            }
        }
我不需要检查更改路径或url。每当我想关闭页面、更改url、刷新等时,我都需要打电话

感谢您的关注。

此处已存在可能的副本