nervgh / angular-file-upload

[ALMOST NOT MAINTAINED] Angular File Upload is a module for the AngularJS framework
MIT License
3.44k stars 1.13k forks source link

How to set uploader attr dynamically in div #847

Open LucasES opened 5 years ago

LucasES commented 5 years ago

I need to create n boxes using n instances of file uploader dynamically. According to the documentation we need set the uploader attribute using an instance of Angular File Uploader.

The attribute uploader must be a instance of FileUploader.

I created an selector with jquery and changed the attribute of this div adding an instance of File Uploader, but not worked. Just like this:

var currentDiv = $('.my-file-uploader-div'); var myFileUploaderInstance = new FileUploader(); $(currentDiv).attr('uploader', myFileUploaderInstance );

Unfortunately not worked