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

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -