Skip to content

Instantly share code, notes, and snippets.

@nicolae-olariu
Created October 26, 2015 12:07
Show Gist options
  • Save nicolae-olariu/2e9a95ed6d6c9b8bda8c to your computer and use it in GitHub Desktop.
Save nicolae-olariu/2e9a95ed6d6c9b8bda8c to your computer and use it in GitHub Desktop.
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;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment