Animating ng-move in AngularJS ngRepeat is animating the wrong items

后端 未结 2 982
醉话见心
醉话见心 2021-02-14 10:43

I\'m a little flummoxed when it comes to animating ng-move in an ng-repeat. If I move an array item from 3 to 7 for instance, items 4-7 get shifted up and they animate. However

2条回答
  •  -上瘾入骨i
    2021-02-14 11:06

    The correct syntax is

    arrayVar.splice(to, 0, arrayVar.splice(from, 1));
    

    To remove and return an element at the index i of array arr, use arr.splice(i, 1),

提交回复
热议问题