2

New to angularjs. I don't really get the angular documentation's explanation on the role of the [ $scope .... as an array. What does inline injection annotation means to this code?

var myApp = angular.module('myApp',[]);

myApp.controller('GreetingCtrl', ['$scope', function($scope) {
    $scope.greeting = 'Hola!';
}]);
  • possible duplicate of [Why is the function in angular's DI inline annotation a array element?](http://stackoverflow.com/questions/21656548/why-is-the-function-in-angulars-di-inline-annotation-a-array-element) – Paul Sweatte Oct 14 '14 at 20:04

1 Answers1

0

This way of injection is useful for later code minification.

falinsky
  • 7,229
  • 3
  • 32
  • 56