Angular event not work as documented
Hi @RubaXa!
I've tried onAdd event callback but evt.item and evt.from not show up.
http://jsfiddle.net/solitary90/m5jq2wcq/
I'm doing wrong?
(I've already tried dev-branch)
I've got the same issue, you can fix it by adding keys in the object in the _emitEvent() function in ng-sortable.js.
So the old one (line 80 from ng-sortable.js)
options[name] && options[name]({
model: item,
models: source && source.items(),
oldIndex: evt.oldIndex,
newIndex: evt.newIndex
});
and the new one
options[name] && options[name]({
model: item,
models: source && source.items(),
oldIndex: evt.oldIndex,
newIndex: evt.newIndex,
from : evt.from,
item : evt.item
});
.from works great but it seems tha .item is a copy of the item and not the original one
Because: https://github.com/RubaXa/Sortable/blob/master/ng-sortable.js#L18-L24
@yohankoehler Working with DOM elements is not Angular way.
@RubaXa You are in a directive.
@yohankoehler So what? Your commit are forwarding DOM elements from directive to outside.
@RubaXa my bad, sorry please forget this commit !!!.
@Raiseupcreativity So I guess you will have to deal with the onRemove event to retrieve the model that the item is comming from.
@yohankoehler Already forgotten :see_no_evil:
yes but I've need access on drag-over target, but i've made another directive for that....