bevacqua / angularjs-dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/angularjs-dragula
MIT License
509 stars 110 forks source link

dragula directive should remove the container on "$destroy" of its element #88

Closed mrahhal closed 6 years ago

mrahhal commented 7 years ago

This causes problems when dragula directive is used on an element that gets removed/attached (in a tab control through ng-if for example) while the scope it's using is still being maintained. The directive will keep on adding the container each time the element gets attached to DOM which will cause duplication (which will cause an error because of accessing off indexes).

The directive should remove the container it attached when its element's "$destroy" event fires. I'm working on a fix.