angularjs - Animating ng-repeat index changes using custom directive -
this forked plunker shows 2 ng-repeat
s each displaying array list. each list item uses custom directive animate whenever or down arrow clicked.
the first list, records changes array item values animates correctly second, records changes array item indexes not.
can suggest how edit directive animate second list correctly?
the way move elements triggers incorrect animation. try this
function arraymove(arrayvar, from, to) { var item = arrayvar.splice(from, 1).pop(); arrayvar.splice(to, 0, angular.copy(item)); }
you need make (deep) copy of element preserve properties $$hashkey
used angularjs track objects.
Comments
Post a Comment