我有一家工厂,
var commonFactories = angular.module('commonFactories', []).
factory('acampaign', function () {
// return {'a' : 1};
return "hello";
});
我将它注入模块,
angular.module("campaign", ["ngRoute", "ngResource", "commonServices", "commonFactories"]).
// configure campaign module
config(["acampaign", function(acampaign) {
...
}
Angular抛出错误,说它无法实例化campaign
模块,
Failed to instantiate module campaign due to:
Error: [$injector:unpr] http://errors.angularjs.org/1.3.12/$injector/unpr?p0=acam...
at Error (native)
at http://localhost:8000/static/assets/angularjs/angular.min.js:6:417
at http://localhost:8000/static/assets/angularjs/angular.min.js:38:7
at d (http://localhost:8000/static/assets/angularjs/angular.min.js:36:13)
at Object.e [as invoke] (http://localhost:8000/static/assets/angularjs/angular.min.js:36:283)
at d (http://localhost:8000/static/assets/angularjs/angular.min.js:34:498)
at http://localhost:8000/static/assets/angularjs/angular.min.js:35:99
at s (http://localhost:8000/static/assets/angularjs/angular.min.js:7:302)
at g (http://localhost:8000/static/assets/angularjs/angular.min.js:34:399)
at ab (http://localhost:8000/static/assets/angularjs/angular.min.js:38:135