0

Might be a silly question but I couldn't figure the solution out myself or google it. I'm using a button for click+upload files. However, I also want to add the drag+drop functionality the same time - using preferably the same flow object and function. Here's my current code:

<div flow-init flow-name="uploader.flow" flow-files-submitted="uploadFiles()" 
flow-file-success="fileUploaded()">
<label for="file-upload" class="upload">Files</label>
<input id="file-upload" type="file" flow-btn>

So I'd like to use the 'uploader.flow' scope for my drag and drop too executing 'uploadFiles()' with it on submit. Here's what I've been trying:

<div flow-init flow-object="...??..." flow-drop 
flow-files-submitted="uploadFiles()" flow-file-success="fileUploaded()" ></div>

I believe myself the issue is only that I can't figure out what to put in flow-object. But I doubt it was that simple. Might be something also with the new init? Should it be done or not.

Another way around of course could be to find the first shared parent element and init it there instead for both the same time? But would this be a bit too vague?

4

1 回答 1

0

So in the end I did what I didn't originally want to do. I went up the parent elements until I found a common one the both were children of and did the initialization for ng-flow there instead.

It works.

于 2016-04-21T13:22:27.007 回答