“上载器"必须是FileUploader的实例 [英] "Uploader" must be an instance of FileUploader

查看:106
本文介绍了“上载器"必须是FileUploader的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我提到了这一点: https://github.com. com/nervgh/angular-file-upload/tree/version-3.0.0-alpha

angular.min.js:14540 TypeError: "Uploader" must be an instance of FileUploader
    at link (http://localhost:8080/services/angular-file-upload.js:1874:24)
    at invokeLinkFn (http://localhost:8080/lib/js/angular.min.js:10445:8)
    at nodeLinkFn (http://localhost:8080/lib/js/angular.min.js:9733:9)
    at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8712:10)
    at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8717:10)
    at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8717:10)
    at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8717:10)
    at compositeLinkFn (http://localhost:8080/lib/js/angular.min.js:8717:10)
    at publicLinkFn (http://localhost:8080/lib/js/angular.min.js:8567:9)
    at link (http://localhost:8080/lib/js/angular-route.js:1053:5) <input type="file" nv-file-select="" uploader="uploader" multiple="">

推荐答案

FileUploader应该位于控制器的全局范围内,以便使对象与FileUploader相对应.我做了一个工厂,并在整个控制器中使用了它.

FileUploader should be in controllers global scope in order to make an object respective to FileUploader. I made a factory and used it throughout the controller.

这篇关于“上载器"必须是FileUploader的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆