简体   繁体   English

Angular 1.2.5嵌套动画

[英]Angular 1.2.5 nested animations

Using ng-view, I would like a simple fadeIn / fadeOut for page transitions. 使用ng-view,我想要一个简单的fadeIn / fadeOut用于页面转换。 However, in different "views" I have child elements that I would like to animate at the same time as the fadeIn/fadeOut are happening on the parent element. 但是,在不同的“视图”中,我有子元素,我希望在父元素上发生fadeIn / fadeOut的同时进行动画处理。 The problem is, that angular cancel's any nested animations if the parent is animating. 问题是,如果父动画是动画的,则角度取消是任何嵌套动画。 Why is this? 为什么是这样? Is there another way to achieve what I want? 还有另一种方法可以实现我想要的吗?

You should be able to use the $animate service instead of ngAnimate. 您应该能够使用$ animate服务而不是ngAnimate。 If you do this, you can chain the animations with a promise. 如果你这样做,你可以用一个承诺链接动画。

https://docs.angularjs.org/api/ngAnimate/service/ $animate https://docs.angularjs.org/api/ngAnimate/service/ $ animate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM