Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngAnimate - Doesn't animate when the ng-repeat scope value is transformed #12128

Closed
clementoriol opened this issue Jun 15, 2015 · 3 comments
Closed

Comments

@clementoriol
Copy link

Hello !
After updating to angular 1.4 and trying myself with the new ngAnimate module, I'm having an issue while trying to animate ng-repeat elements, with filtered data.

It looks like a bug with the module, more than my misdoing, so I'm submitting this issue :

If the scope element the ng-repeat is iterating over is transformed in some way (like filtered (the native Array function) from a controller, in my exemple), ngAnimate gets a little crazy. When using "addClass" / "removeClass", the event almost doesn't trigger, so nothing is animated. When using "enter" or "leave", old copies of the repeated element are not destroyed. Without registrating the animation on the module, everything is fine.

I prepared two plunkers to illustrate the various issues :

addClass / removeClass issues :
http://plnkr.co/edit/cpU7mBvHDfZu7OqSWyf4?p=preview

enter / leave issues :
http://plnkr.co/edit/07KUZxeeOasCfhv6hiFA?p=preview

Reproducible: always
Browsers: Chrome 43, Firefox 38
Operating system: OSX 10.9.5

Edit 1 : The issue remains the same when using custom filters with the angular filter module
Edit 2 : The issue only seems to happen when trying to animate an element containing a ng-repeat with filtered data (either filtered from the controller or using an angular filter)

@sreeramu
Copy link
Contributor

sreeramu commented Jul 5, 2015

addClass / removeClass issue is caused due to ngRepeat collection is dynamically changed so both enter and removeClass animation events are fired at same time as the animation enter event is structural event when the structural event is executed the parents classBasedAnimation(ie:removeClass) so that only removeClass is not executed.

animateQueue.js file

if (animationDetails.structural) {
    closeParentClassBasedAnimations(parentElement);
}

@Narretz
Copy link
Contributor

Narretz commented Jan 14, 2016

The first issue is fixed in the current snapshot as far as I can tell. The second one seems to be broken still.

@Narretz
Copy link
Contributor

Narretz commented Jan 14, 2016

The second issue is not an issue: you have to call the done fn in your javascript animations, otherwise the animator does not know when the animations are finished: http://plnkr.co/edit/RzV1Fj5aQpSPNoAhjWk9?p=preview

@Narretz Narretz closed this as completed Jan 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants