【发布时间】:2014-02-17 09:23:00
【问题描述】:
我想知道下两行之间是否有区别,以及为什么要使用其中之一(两者按预期工作)
phonecatApp.controller('PhoneListCtrl', function($scope, $http) {...});
phonecatApp.controller('PhoneListCtrl', ['$scope', '$http', function($scope, $http) {...}]);
我从官方 AngularJS 教程中得到它,我知道有关于这个修改的解释,但我不明白...... http://docs.angularjs.org/tutorial/step_05
提前致谢!
【问题讨论】:
标签: angularjs dependency-injection