4

Dropzone js is an awesome plugin used for drag & drop upload. I want it to implement in my angularjs project.

Please find the scenario, which I have tried

I have included

<form id="my-awesome-dropzone" action="/target" class="dropzone"></form>

inside partial view, while executing the page in browser tag itself removed from DOM.

When I include it in index.html page, it is working properly. Please let me know how to make dropzone working, inside angularjs partial view.

Thev
  • 59
  • 12
Dinesh Nk
  • 89
  • 9

2 Answers2

2

I run into the same problem. For reproduction, the dropzone selector new Dropzone('#selector') is not working as aspected on default templates. The selector fails on async. loaded views. There is a easy fix. Init dropzone on a form will enforce dropzone template rendering correctly.

View

<form id="dropzone-form" class="dropzone"></form>

JavaScript

var myDropzone = new Dropzone('#dropzone-form', {
    url: "/file/post"
});
lin
  • 17,956
  • 4
  • 59
  • 83
0

You mentioned that you included:

<form id="my-awesome-dropzone" action="/target" class="dropzone"></form>

The issue may simply be that you included the above form "inside" another form.

  • This does not provide an answer to the question. Once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment](http://stackoverflow.com/help/privileges/comment) on any post. Also check this [what can I do instead](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). – thewaywewere Jun 09 '17 at 01:12