未知提供程序错误 Angular
Unknown Provider error Angular
Error: [$injector:unpr] Unknown provider: flowFactoryProviderProvider <- flowFactoryProvider <- flowFactoryHeaders
http://errors.angularjs.org/1.3.15/$injector/unpr?p0=flowFactoryProviderProvider%20%3C-%20flowFactoryProvider%20%3C-%20flowFactoryHeaders
minErr/<@http://unika.localdomain/bower_components/angular/angular.js:63:12
这是我的代码,也许我只是累了,但我正在尝试将提供者注入工厂,但我尝试过的都没有奏效。我正在尝试更改 flowFactoryProvider 中的值,flowFactoryProvider.defaults
var upload = angular.module('UploadModule', [ 'ngResource','flow' ])
upload.config(
[ 'flowFactoryProvider',function(flowFactoryProvider) {
//AuthService.getKeycloak();
flowFactoryProvider.defaults = {
target : 'https://localhost:8443/unika/upload',
permanentErrors : [ 500, 501 ],
maxChunkRetries : 1,
chunkRetryInterval : 5000,
simultaneousUploads : 4,
progressCallbacksInterval : 1,
withCredentials : true,
method : 'octet',
};
flowFactoryProvider.on('catchAll', function(event) {
console.log('catchAll', arguments);
});
// Can be used with different implementations of Flow.js
// flowFactoryProvider.factory = fustyFlowFactory;
} ]);
upload.factory('flowFactoryHeaders',['flowFactoryProvider',function(flowFactoryProvider) {
var token;
var setToken = function(token){
this.token = token;
}
var getToken = function(){
return this.token;
}
/*var updateHeaders = function(){
flowFactoryProvider.defaults.headers = {'Authorization':'Bearer ' + token}
}*/
return {
setToken: setToken,
getToken: getToken
};
}]);
Providers are available with Provider
post-fix only config phase only
您无权访问 factory
内的 provider
,他们在服务中命名为没有提供者后缀。这里只是flowFactory
代码
upload.factory('flowFactoryHeaders',['flowFactory',function(flowFactory) {
Error: [$injector:unpr] Unknown provider: flowFactoryProviderProvider <- flowFactoryProvider <- flowFactoryHeaders
http://errors.angularjs.org/1.3.15/$injector/unpr?p0=flowFactoryProviderProvider%20%3C-%20flowFactoryProvider%20%3C-%20flowFactoryHeaders
minErr/<@http://unika.localdomain/bower_components/angular/angular.js:63:12
这是我的代码,也许我只是累了,但我正在尝试将提供者注入工厂,但我尝试过的都没有奏效。我正在尝试更改 flowFactoryProvider 中的值,flowFactoryProvider.defaults
var upload = angular.module('UploadModule', [ 'ngResource','flow' ])
upload.config(
[ 'flowFactoryProvider',function(flowFactoryProvider) {
//AuthService.getKeycloak();
flowFactoryProvider.defaults = {
target : 'https://localhost:8443/unika/upload',
permanentErrors : [ 500, 501 ],
maxChunkRetries : 1,
chunkRetryInterval : 5000,
simultaneousUploads : 4,
progressCallbacksInterval : 1,
withCredentials : true,
method : 'octet',
};
flowFactoryProvider.on('catchAll', function(event) {
console.log('catchAll', arguments);
});
// Can be used with different implementations of Flow.js
// flowFactoryProvider.factory = fustyFlowFactory;
} ]);
upload.factory('flowFactoryHeaders',['flowFactoryProvider',function(flowFactoryProvider) {
var token;
var setToken = function(token){
this.token = token;
}
var getToken = function(){
return this.token;
}
/*var updateHeaders = function(){
flowFactoryProvider.defaults.headers = {'Authorization':'Bearer ' + token}
}*/
return {
setToken: setToken,
getToken: getToken
};
}]);
Providers are available with
Provider
post-fix only config phase only
您无权访问 factory
内的 provider
,他们在服务中命名为没有提供者后缀。这里只是flowFactory
代码
upload.factory('flowFactoryHeaders',['flowFactory',function(flowFactory) {