diff --git a/example-dropdata.html b/example-dropdata.html new file mode 100755 index 0000000..201092f --- /dev/null +++ b/example-dropdata.html @@ -0,0 +1,80 @@ + + + + ngDraggable + + + + + +
+ +
+

ngDraggable Example

+
+ + + +
+ + + + + + + diff --git a/ngDraggable.js b/ngDraggable.js index 3f4a2ee..3d83bf6 100644 --- a/ngDraggable.js +++ b/ngDraggable.js @@ -281,6 +281,8 @@ angular.module("ngDraggable", []) var onDragStopCallback = $parse(attrs.ngDragStop); var onDragMoveCallback = $parse(attrs.ngDragMove); + var getDragData = $parse(attrs.ngDragData); + var initialize = function () { toggleListeners(true); }; @@ -339,8 +341,9 @@ angular.module("ngDraggable", []) } if (attrs.ngDropSuccess) { + var _data = getDragData(scope); $timeout(function(){ - onDropCallback(scope, {$data: obj.data, $event: obj, $target: scope.$eval(scope.value)}); + onDropCallback(scope, {$data: obj.data, $event: obj, $dropdata: _data, $target: scope.$eval(scope.value)}); }); } }