My angular application ran well in development. But in production there were build issues. The issues occurred since I use ng-annotate for annotation. I came across an answer to use 'ngInject' in the controller to solve the issue. Using 'ngInject' like this
angular.module("app").controller("appCtrl", function($scope, $timeout) {
"ngInject";
...
});
is said to prevent minification issues.
My question is, I have several controllers in my application. Do I have to use 'ngInject' in all the controllers or is there a place to declare it globally for all controllers?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…