动画NG-举动在AngularJS ngRepeat动画是错误的项目 [英] Animating ng-move in AngularJS ngRepeat is animating the wrong items
问题描述
我有点狼狈不堪,当谈到在NG-重复动画NG-举动。如果我从3移动数组项到7例如,项目4-7获得上移,他们的动画。然而,实际的项目,我从3移动并放置在位置7,其实不然。这里有一个plunkr证明了我的问题。
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 the actual item I moved from 3 and placed in position 7, does not. Here's a plunkr demonstrating my issue.
<一个href=\"http://plnkr.co/edit/4yRkLWbsU57YxrYOrWUQ?p=$p$pview\">http://plnkr.co/edit/4yRkLWbsU57YxrYOrWUQ?p=$p$pview
移动项目7:3,但是,工程,我期望,动画单移动的项目,而不是已经被推下的项目。
Moving item 7 to 3, however, works as I expect, animating the single moved item, and not the items that have been pushed down.
这是不是显示什么移动用户非常有用的。应该如何正确的人的动画NG-举动?
This is not very useful for showing a user what moved. How should someone properly animate an ng-move?
推荐答案
@tasseKat具有优良的答案,这也解释了你观察到的行为:<一href=\"http://stackoverflow.com/a/27616435/1652643\">http://stackoverflow.com/a/27616435/1652643
@tasseKat has an excellent answer, which explains the behavior you observed: http://stackoverflow.com/a/27616435/1652643
不过,他的解决方案是不是你都希望那样简单......但到目前为止,我还没有找到更好的东西。
However, his solution is not as simple as you would wish... but so far I haven't found anything better.
这篇关于动画NG-举动在AngularJS ngRepeat动画是错误的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!