如何动态初始化文件上传?

时间:2017-03-03 09:50:14

标签: angularjs file-upload

如何在点击后以动态方式初始化此对象并将其绑定到模板中?

$scope.send = function(){

var setting = {};

var uploader = new FileUploader({
                    url: settings.path,
                    alias: settings.alias,
                    formData: settings.data,
                    autoUpload: true,
                    queueLimit: settings.limit
                });

}

对象uploader将在模板中可用:

<div class="attachements" nv-file-drop="" uploader="uploader"></div>

现在,在加载页面后我收到错误,应该定义uploader

  

TypeError:“Uploader”必须是FileUploader的实例

0 个答案:

没有答案