Closed goleafs closed 8 years ago
Yea, that's just how this directive works. It changes the model and let's ng-repeat
do it's magic and emit the new HTML based on the model & the template.
In the README though, you can check out the Static HTML Sorting example which might help you a bit.
Not setting ng-model
might do the trick.
But obviously, in case that you care about storing the new model order, using a caching layer for your service sound as the most appropriate way for an implementation.
Using ui-sortable and it's working well.
The issue I have is that the content of the html element that is moved, is an angular component (or directive). When the position is swapped, the component is re-initialized (recreated from scratch). Since this component is calling back end data, this is not ideal, and the user experience is pretty bad.
Is there a way to just move the dom element and not have angular re-initialize the component?