Closed victordelacruz closed 8 years ago
The reason is that the model is setup at the directive's linking phase once. If later the model changes, this is not updated in the directive internals.
https://github.com/bevacqua/angular-dragula/pull/35 Fixes this.
Use example: Say you have an empty list (this is your model) that a later stage you want to load with an ajax call contents.
Isn´t it the problem that you just want to assign a new array to the dragula-model?
As described in other issues you are currently not allowed to do something like this:
vm.badgeList = newArray;
You need to hold the reference and just refill the current array
vm.badgeList.length = 0; //clears the array
newItemsArray.forEach(function(item) {
vm.badgeList.push(item);
});
Yes that's exactly the problem and this PR solves it.
I just wanted to let you know that its even now possible thorugh the refill.
The changes you ve done are looking good to me.
Thanks for the observation Daniel, I have considered that option too, but found it a bit cumbersome on the user.
I'd like to work just as ng-repeat does, you point it to a new array and it works as expected, it considers the new values and goes through them.
Hello guys,
I'm trying out the angular version of dragula, and have this code in my view:
And this other code in my controller:
The problem is that I'm not receiving the
drop-model
event.dragend
anddrop
works just fine. What could be the reason?