Angular UI 带有 ng-enter-stagger 的路由器

Angular UI Router with ng-enter-stagger

我希望有人能帮助我,我已经坚持了一段时间。

我这里有一个简单的 jsfiddle:http://jsfiddle.net/mcneela86/aodsux3p/ 这是使用 ng-enter-stagger class 来错开每个列表项上的动画,它似乎工作正常。

然后我尝试将此方法与 ui-router 上的应用程序 built 一起使用,但动画不工作:http://plnkr.co/edit/IDpTQuwELq0zWsqMDrPw?p=preview

我是不是做错了什么,或者这种动画方法在 ui-router 中不起作用? 任何帮助将不胜感激。

在 JSFiddle AngularJS 中使用 1.2.1 版,而在 Plunker 中使用 1.4.1 版。这两个版本之间发生了很多变化。

来自文档:

Are animations run when the application starts?

No they are not. When an application is bootstrapped Angular will disable animations from running to avoid a frenzy of animations from being triggered as soon as the browser has rendered the screen. For this to work, Angular will wait for two digest cycles until enabling animations. From there on, any animation-triggering layout changes in the application will trigger animations as normal.

在这种情况下,您可以使用 ng-animate-children 属性。

例如:

<ul ng-animate-children>
    <li class="list-item" ng-repeat="dog in dogs">{{ dog }}</li>
</ul>

演示: http://plnkr.co/edit/X2DDZUuspOEWEWkADtxw?p=preview