What is the difference between these two angularjs controller definition -
i don't understand difference between these 2 types of angularjs controller definition, have tried following codes , found both working
myapp.controller('greetingcontroller', ['$scope', function($scope) { $scope.greeting = 'hola!'; }]); myapp.controller('greetingcontroller', function($scope) { $scope.greeting = 'hola!'; });
first 1 cares minification.
in controller:
myapp.controller('greetingcontroller', function($scope) { $scope.greeting = 'hola!'; }); arguments minimized short values , dependency injection not work.
please at:
Comments
Post a Comment