Detect where drop occured (ng-flow)

123 Views Asked by At

I am using ng-flow for drag & drop files and upload to server. The page I am developing has multiple drop listeners . Is there a way to detect on which element the drop occurred ?

    <body ng-app="droptest" flow-init="{target:''}"> 
    <div name="drop1" class="fa fa-paperclip fa-rotate-90 Cell small" flow-drop="" title="Drag/Drop files to upload to this record"></div>
 <div name="drop2" class="fa fa-paperclip fa-rotate-90 Cell small" flow-drop="" title="Drag/Drop files to upload to this record"></div>
     </body>

 $scope.$on('flow::fileAdded', function (event, $flow, flowFile) {
   //how to detect whether drop occured on drop1 or drop2?
});
1

There are 1 best solutions below

0
On BEST ANSWER

I figured it out

 $scope.$on('flow::fileAdded', function (event, $flow, flowFile, elementDetails) {
               elementDetails.target 
         });