2

I've been reading angular js dependency injection reference here

Angular DI

There they claim that the recommended way of injecting dependencies is

myModule.controller('myController',['$scope','dep1',
                                    function($scope1,dep1){
            //Controller code
}]);

Rather than implicit injection

myModule.controller('myController',function($scope,dep1){
            //Controller code
});

And they even mention the second way is less tightly coupled but insist on using the first type of injection

Is there any valid technical reason for this?

Julio Bastida
  • 1,180
  • 1
  • 14
  • 30

0 Answers0