在angularJS中使用angular-cached-resource的未知提供商
Unknown provider in angularJS with angular-cached-resource
我已经在我的angular应用程序中正确地添加了一个JS文件angular-cached-resource (https://github.com/goodeggs/angular-cached-resource),并试图实例化它:
angular.module('client.core.resources')
.factory('TranslationResource', ['$cachedResource', 'ConstantValueService', function ($cachedResource, ConstantValueService) {
var localizationUrl = ConstantValueService.get('webApiUri') + '/api/localization/';
// TODO adjust webapi to work.
return $cachedResource('translationResource', localizationUrl, {lang: '@lang'},
{
getTranslationForCulture: {
method: 'GET',
isArray: true
},
});
}]);
但是我得到错误:
[$injector:unpr]未知提供商:$cachedResourceProvider <-$cachedResource <- TranslationResource <- TranslationService错误。
我可能做错了什么?
$cachedResource
服务是ngCachedResource
模块的一部分,因此为了使用它,你需要在你的应用程序中将ngCachedResource
列为依赖项。
angular.module('myApp',[...,'ngCachedResource'])....
相关文章:
- 角度模态服务未知提供商
- JsFiddle:未知提供商:$intervalProvider <- $interval
- 工厂和控制器,未知提供商
- 未知提供商:$resourceProvider - AngularJS
- 未知提供商:捆绑后$resourceProvider
- AngularJS + RequireJS.未知提供商:$routeProvider
- 未知提供商AngularJs在添加“时”;.运行”;
- Angular未知提供商错误
- AngularJS错误:未知提供商
- 为什么我得到$injector:unpr(未知提供商)在这个单页应用程序
- 在angularJS中使用angular-cached-resource的未知提供商
- Angularjs、Typescript、Uglify和static $inject:未知提供商
- Angular $injector——为Angular提供的未知提供商's $timeout
- 未知提供商:uniqueFilterProvider,在Angular.js中使用唯一过滤器
- Angularjs、Typescript、Uglify实例化myApp模块失败未知提供商:a
- 错误:[$injector:unpr]未知提供商:ngCsv <- ngCsv <- dynamicDemoContro
- 使用Jasmine在AngularJS中测试服务时,未知提供商
- 在angularJS中创建过滤器时为angular提供的未知提供商
- 获取"错误:[$injector:unpr]未知提供商"错误
- AngularJS错误:[$injector:unpr]未知提供商:$achorScrollProvider <- $a