Dragula angular how to access the model item Dragula angular how to access the model item angularjs angularjs

Dragula angular how to access the model item


I had the same problem and solved it by adding the id of the item to the HTML element.

Something like this:

<div id="{{ user.id }}" ng-repeat='user in usersNotInProject' ng-bind='user.email'></div>

In the controller I look up the item using the id:

$scope.$on('bag.drop-model', function (e, el, target, source) {    //getById is a function you implement (unless you already have it)    console.log(usersNotInProject.getById(el.attr('id')).email);});