ngDraggable
ngDraggable copied to clipboard
[question] how can I grab the $element of a drop area?
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!
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);
}