I have multiple flow-btn
elements on my page. There is a list of items that the user can upload single files directly in to (individually) or they can choose to upload multiple files which will automatically populate the list. Everything is inside a flow-init
.
A bit like this pseudo-code example:
<div flow-init>
<div flow-btn>Upload multiple images to fill the list</div>
<h3>The list</h3>
<ul>
<li ng-repeat="item in items">
<div flow-btn flow-single-file>Upload an image for this item</div>
<img flow-img="item.flowFile">
</li>
</ul>
</div>
I need to identify which flow-btn
was used within the list so that I can display the uploaded image thumbnail at the correct point. Basically I think I want access to the item
from a flow event.
Note: The list loop data is defined by other data, so I can't just loop through $flow.files
to create my list.
How can I do this?
Should I create a new flow-init
instance for each loop item? Overkill?
Edit: Alternatively, perhaps I can open the multiple flow-btn
from my controller programmatically rather than having a flow-btn
for each item?? In which case I could stash the current item in the controller.