0

what analogue in angular for window.onbeforeunload i have modal-dialog and i need to call it before un load.

$scope.toggleModal = function (modalChoice) {
            switch (modalChoice) {
                case 'error':
                    $scope.modalErrorShown = !$scope.modalErrorShown;
                    break;
                case 'end':
                    $scope.modalEndShown = !$scope.modalEndShown;
                    break;
            }
        }

i dont need to check for changing path or url. I need to call every time when i want to close page, change url, refreshening, etc.

Thanks for your attention.

inatoff
  • 151
  • 2
  • 12
  • possible duplicate of [How to send an HTTP request onbeforeunload in AngularJS?](http://stackoverflow.com/questions/21689233/how-to-send-an-http-request-onbeforeunload-in-angularjs) – Raúl Martín Jul 01 '15 at 15:29
  • Already here http://stackoverflow.com/questions/11777890/equivalence-of-window-onbeforeunload-in-angularjs-for-routes – borja gómez Jul 01 '15 at 15:36

0 Answers0