检测发生跌落的位置(ng-flow)

时间:2015-06-10 16:36:24

标签: javascript angularjs ng-flow

我正在使用ng-flow进行拖动和放大删除文件并上传到服务器。我正在开发的页面有多个drop listener。有没有办法检测掉落发生在哪个元素上?

    <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 个答案:

答案 0 :(得分:0)

我想通了

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