I'm new in angular, want to know why and when we should inject all our needed dependencies two times.
Example :
var analysisApp=angular.module('analysisApp',[]);
analysisApp.controller('analysisController',function($scope,$http,$cookies,$state,globalService){
});
But we can also write the above code as :
var analysisApp=angular.module('analysisApp',[]);
analysisApp.controller('analysisController',['$scope','$http','$cookies','$state','globalService',function($scope,$http,$cookies,$state,globalService){
}]);
Why ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…