0
有可能有一個工廠沒有依賴關係,聲明也能像......AngularJS工廠沒有任何依賴關係注入
//from this...
angular.module('myModule').factory('factoryName',['$http',function($http){
//TODO code here...
}]);
//to this...
angular.module('myModule').factory('factoryName',[ ,function(){
//TODO code here...
}]);
,因爲我使用的工廠作爲一個單獨的對象,但瀏覽器控制檯拋出角一般性錯誤,所以我的觀點是工廠必須有注入的依賴關係,感謝
刪除額外的逗號...'[功能....'不''[,功能...' – charlietfl