Closed lewis500 closed 11 years ago
Hi Lewis,
It's for dependency injection, more info can be found here http://docs.angularjs.org/guide/di
Example from link:
angular.module('myModule', []).
config(['depProvider', function(depProvider){
...
}]).
factory('serviceId', ['depService', function(depService) {
...
}]).
directive('directiveName', ['depService', function(depService) {
...
}]).
filter('filterName', ['depService', function(depService) {
...
}]).
run(['depService', function(depService) {
...
}]);
Hi, I was curious why the directive snippet has an array like directive('', ['', function(){... when the documentation and most examples I've seen just have directive( " , function(){ ?