ng-annotate

What is the best practice for dependency injection annotation with AngularJS?

与世无争的帅哥 提交于 2020-01-14 03:03:19
问题 So thanks to ng-annotate, now we can minify our code successfully when it looks like this: angular.module('YeomanApp') .controller('YeoCtrl', function ($scope) { $scope.awesomeThings = [ 'HTML5 Boilerplate', 'AngularJS', 'Karma' ]; }); Are there any advantages to this form over this form: angular.module('YeomanApp') .controller('YeoCtrl', ['$scope', function ($scope) { $scope.awesomeThings = [ 'HTML5 Boilerplate', 'AngularJS', 'Karma' ]; }]); The latter explicit dependency declaration seems