KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm getting this error while trying to call function MyCtrl1($scope, $location, $rootScope) { $scope.$on('$locationChangeStart', function (event, next, current) { event.preventDefault(); var answer = confirm("Are you sure you want to leave this page?"); if (answer) { $location.url($location.url(next).hash()); $rootScope.$apply(); } }); } MyCtrl1.$inject = ['$scope', '$location', '$rootScope']; Error is Error: $digest already in progress
Tags (comma-separated)
Save Edits
Cancel