This question already has an answer here:
HI I've seen 2 ways of dependency injection in angularjs controller Method1:
mainApp.controller('CalcController', function($scope, CalcService, defaultInput) {});
Method2:
mainApp.controller('CalcController', ['$scope', 'CalcService', 'defaultInput',function($scope, CalcService, defaultInput) {}]);
What is the diffrence between method1 and method2?