Last active
July 11, 2017 07:37
-
-
Save iamdevlinph/fef6b730fee2a66ead1c45cef7196743 to your computer and use it in GitHub Desktop.
Angular - find cause of "[$Injector:unpr] Unknown provider: eProvider <- e" when minified
This file contains hidden or 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
// Just a tip for ppl debugging such issues in 1.2 - | |
// This is a short snippet I wrote that will print an error to the console with the contents of the guilty (minified) function. | |
// All you need to do is put a breakpoint before angular bootstraps, paste the snippet in the console and release the debugger. | |
Object.defineProperty(Function.prototype, '$inject', { | |
configurable: true, | |
get: function() { | |
return this.$injectHooked; | |
}, | |
set: function (arr) { | |
if (arr.length && arr[0].length < 3) { | |
console.error('missing @ngInject:', this); | |
} | |
return this.$injectHooked = arr; | |
} | |
}); | |
// Source https://github.com/angular/angular.js/issues/4504#issuecomment-56023595 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment