ich diesen Fehler beim Versuch,
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'];
Fehler zu nennen ist
Error: $digest already in progress
Dies ist eine sehr alte Post, aber immer noch können Sie auf dieses Thema beziehen: http://www.boynux.com/angularjs-apply-explained/ Ich habe versucht, $ Digest in progress sehr einfach zu erklären. – Boynux