codef0rmer/angular-dragdrop — pull request #14 by wesleycho (2013-04-12 19:51:46+00:00)
Title: Added support for multiple inputs to callbacks for 'onStart', 'onDrag', 'onDrop', etc.

Added support for (optional) multiple inputs to callbacks for 'onStart', 'onDrag', 'onStop', 'onOver', 'onOut', and 'onDrop'.

Example:

__HTML__

__JS__ (in controller)

$scope.dragCallback = function(index) {
console.log('You are currently dragging ' + index);
};

This vastly expands what is possible with the plugin, and taps into more of the flexibility that the original plugin affords.

The `invokeDrop`, `move`, `mutateDraggable`, and `mutateDroppable` functions are moved into a service within the `ngDragDrop` module, which allows them to be properly injected within the Angular context.

The tests are accordingly rewritten to account for this change, and a test is written to test the proposed additional functionality. I could not get the tests to be automated properly due to Node, Karma, and/or Jasmine not binding the callbacks correctly with the calls to the jQuery UI methods `draggable` and `droppable`, but I manually verified the logic in the Chrome browser console.