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

ngAnimate 1.4.1 causes rootScope digest/apply per element animated #12281

Closed
startswithaj opened this issue Jul 7, 2015 · 2 comments
Closed

Comments

@startswithaj
Copy link
Contributor

ngAnimate inconjunction with ng-repeat causes a rootScope digest/apply per element animated.

This is the actual angular ng-repeat animation plunkr modified to demostrate the issue. You need to open inspector and view console log. Then type 'j' in the search field. When you filter down the elements and they animate you get a digest per animated row. Without the animation you get just the single digest or double digest for dirty checking.

No Animation - 2 digests happen on the rootscope level (for dirty checking)
http://plnkr.co/edit/lf70ifdNEh0wftQCqmEy

Animation class on ng-repeat 8 digests happen - 1 rootscope digest per element animated
http://plnkr.co/edit/l1vXyxqBYVLrOHnBc1vK

This is the easiest way to illustrate it. Is this desired behaviour? If its going to digest shouldnt it just digest the scope its in rather than do an $apply and bubble digests all the way up/down from the rootscope?

@startswithaj
Copy link
Contributor Author

$timeout(onAnimationExpired, maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime);

$timeout(onAnimationExpired, maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime);

This line is missing the third invokeApply parameter false.

$timeout(onAnimationExpired, maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime, false);

The stagger code @

$timeout(onAnimationExpired, maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime);

Does apply the this third parameter and does not cause multiple $applys.

@startswithaj
Copy link
Contributor Author

#12282

@Narretz Narretz added this to the 1.4.3 milestone Jul 10, 2015
@matsko matsko modified the milestones: 1.4.3, 1.4.4 Jul 14, 2015
@matsko matsko closed this as completed in 7db5f36 Jul 16, 2015
netman92 pushed a commit to netman92/angular.js that referenced this issue Aug 8, 2015
This change calls $timeout with the invokeApply
parameter set to false which stops ngAnimate
from invoking its changes inside an $apply block

Closes angular#12281
Closes angular#12282
ggershoni pushed a commit to ggershoni/angular.js that referenced this issue Sep 29, 2015
This change calls $timeout with the invokeApply
parameter set to false which stops ngAnimate
from invoking its changes inside an $apply block

Closes angular#12281
Closes angular#12282
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