Last active
July 28, 2017 00:14
-
-
Save DimitarNestorov/652596709382ef22e736499abcd6f911 to your computer and use it in GitHub Desktop.
[$rootScope:inprog] null already in progress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exceptionHandler(){ | |
const error = Error; | |
const nullMessage = "[$rootScope:inprog] null already in progress"; | |
function exception(message){ | |
if(message.indexOf(nullMessage) === 0){ | |
const $rootScope = exceptionHandler.$rootScope; | |
if($rootScope) $rootScope.$$phase = null; | |
const exception = new error(nullMessage); | |
exception.stack = ""; | |
return exception; | |
} | |
return new error(message); | |
} | |
Error = exception; | |
} | |
exceptionHandler(); // If it's not run AngularJS will use the original Error constructor, the one we're decorating |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.run(["$rootScope", function($rootScope){ | |
exceptionHandler.$rootScope = $rootScope; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment