DanialFarid Ng文件上传问题

时间:2015-06-05 16:25:15

标签: javascript angularjs ng-file-upload

我正在使用您的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){

需要帮助...... !!!

1 个答案:

答案 0 :(得分:1)

我得到了解决的感谢谢谢我们错过了在app.js中添加它作为我的依赖项我添加了ngFileUpload依赖并且它开始工作