0

我正在使用您的 Angular 文件上传(https://github.com/danialfarid/ng-file-upload#contrib

我的项目中只有 Angular,我没有 Bower 或任何其他东西。

我遇到的问题是突然之间它开始抛出下面提到的错误,并且由于某种原因,即使在做了所有事情之后我也无法让它工作。

Error: [$injector:unpr] Unknown provider: UploadProvider <- Upload 
http://errors.angularjs.org/1.2.28/$injector/unpr?p0=UploadProvider%20%3C-
%20Upload at http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:78:12 at 
http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:3801:19 at 
Object.getService [as get] 
(http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:3929:39) at 
http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:3806:45 at getService 
(http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:3929:39) at invoke 
(http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:3956:13) at 
Object.instantiate 
(http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:3976:23) at 
http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:7315:28 at 
http://localhost:8080/Rsdf/Rsdf_Common/lib/ui-bootstrap-tpls-
0.12.0.min.js:8:29473 at wrappedCallback 
(http://localhost:8080/Rsdf/Rsdf_Common/lib/angular.js:11682:81)

我已经包含了所有这些文件

<script src="Rsdf_Common/lib/ng-file-upload-bower-4.2.4/ng-file-upload-shim.min.js"></script> 
<script src="Rsdf_Common/lib/ng-file-upload-bower-4.2.4/ng-file-upload.min.js"></script>
<script src="Rsdf_Common/lib/ng-file-upload-bower-4.2.4/ng-file-upload-all.js"></script>
<script src="Rsdf_Common/lib/ng-file-upload-bower-4.2.4/FileAPI.js"></script>

这是我的控制器定义,你可以看到我已经注入了上传模块,但它似乎仍然不起作用

rsdf.controller('fileUploadCtrl',function($scope,$modalInstance,notificationService,$http,userInfo,$timeout,$log,Upload){

需要帮忙 ...!!!

4

1 回答 1

1

我解决了这个问题,谢谢大家,我错过了在 app.js 中添加它作为我的依赖项,我添加了 ngFileUpload 依赖项,它开始工作

于 2015-06-05T16:32:50.753 回答