ngDraggable icon indicating copy to clipboard operation
ngDraggable copied to clipboard

[question] how can I grab the $element of a drop area?

Open matiastucci opened this issue 10 years ago • 2 comments

How can I grab the $element of the drop area once the drop is success

I have 2 drop areas, for example:

<div class="drop-area-1" ng-drop="true" ng-drop-success="onDropComplete($data, $event)"></div>
<div class="drop-area-2" ng-drop="true" ng-drop-success="onDropComplete($data, $event)"></div>

and on the onDropComplete I want to apply a CSS class to that drop area.

The element in $event.element is the one I dragged

Thanks!

matiastucci avatar Aug 13 '15 03:08 matiastucci

TinChip avatar Feb 01 '16 11:02 TinChip

just pass the drop data as the third parameter. :smile_cat:

<div ng-drop="true" ng-drop-success="onDropComplete($data,$event,dropdata)"></div>

$scope.onDropComplete = function(data,event,drop){
  console.log(drop);

}

keithics avatar Mar 04 '16 09:03 keithics