gpt4 book ai didi

angularjs angular-file-upload 未知提供程序 : $uploadProvider error

转载 作者:行者123 更新时间:2023-12-04 23:21:19 25 4
gpt4 key购买 nike

这不是 This Question 的副本

我已在 View 中包含所有必需的文件:

<script src="~/Scripts/angular-file-upload-master/examples/console-sham.min.js"></script>
<script src="~/Content/js/angular.js"></script>
<script src="~/Scripts/angular-file-upload-master/angular-file-upload.js"></script>

我的模块和 Controller :
var controllers = angular.module('controllers', ['ngGrid', 'ngDialog', 'angularFileUpload']);

controllers.controller('CustomProductsCtrl',
['$scope', '$window', 'ngDialog', 'CommonService',
'CustomProductsServices', '$upload',
function ($scope, $window, ngDialog, CommonService,
CustomProductsServices, $upload){

});

但我仍然收到此错误。

错误:[$injector:unpr] 未知提供者:$uploadProvider

请帮帮我。

最佳答案

遇到同样的问题,原来注入(inject)$upload的文档已经过时了,应该是FileUploader:

controllers.controller('CustomProductsCtrl',
[..., '$upload', function (..., 'FileUploader') {

花费的时间比我想承认的要多。仅供引用,我通过查看 angular-file-upload.js 确定了这一点:
.factory('FileUploader', ['fileUploaderOptions', '$rootScope', '$http', '$window', '$compile',

关于angularjs angular-file-upload 未知提供程序 : $uploadProvider error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25800833/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com