我是 Angular.JS 的新手,我正在尝试进行依赖注入,但我得到了这个:
// Definition
app.factory('Reload', function (load, $timeout, timeout) {
if (!timeout) {
timeout = 15 * 1000; // reload page every quater minute by default
}
return $timeout(load, timeout);
});
// Controller
app.controller('SomeController', function ($scope, $routeParams, $location, $timeout, Installer, Reload) {
Reload(load, $timeout, 1000);
});
Error: Unknown provider: loadProvider <- load <- Reload
at Error (<anonymous>)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2734:15
at Object.getService [as get] (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2862:39)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2739:45
at getService (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2862:39)
at Object.invoke (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2880:13)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2740:37
at getService (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2862:39)
at invoke (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2880:13)
at Object.instantiate (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js:2914:23)
我错过了什么?谢谢