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

fix($animate): wait two until two digests are over until enabling animations #8846

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Aug 29, 2014

Even when no remote templates are to be downloaded, wait two digests until
enabling animations since all structural digests perform a post digest before
running animations.

Closes #8844

Broken Example (no remote templates -> snapshot):
http://plnkr.co/edit/LREaTTieMJj4lOPJTjI0?p=preview

Working example (no remote templates -> this fix):
http://plnkr.co/edit/CuigpbMIB4ZkdmhWJ1bO?p=preview

Working example (remote templates -> snapshot)
http://plnkr.co/edit/QLD5TVtWnHGvCLnFcCYw?p=preview

Working example (remote templates -> this fix)
http://plnkr.co/edit/YtjFzsb7bR2AwfXD9lF2?p=preview

@@ -412,33 +412,27 @@ angular.module('ngAnimate', ['ng'])
$rootElement.data(NG_ANIMATE_STATE, rootAnimateState);

// disable animations during bootstrap, but once we bootstrapped, wait again
// for another digest until enabling animations. Enter, leave and move require
// for another 2 digests until enabling animations. Enter, leave and move require
// a follow-up digest so having a watcher here is enough to let both digests pass.
// However, when any directive or view templates are downloaded then we need to
// handle postpone enabling animations until they are fully completed and then...
var watchFn = $rootScope.$watch(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you call this deregisterWatch instead?

@matsko matsko force-pushed the fix_ng_animate_no_templates branch from 17092df to 6c51974 Compare August 29, 2014 19:08
@matsko matsko force-pushed the fix_ng_animate_no_templates branch from 6c51974 to fce672d Compare August 29, 2014 19:11
…mations

Even when no remote templates are to be downloaded, wait until the end of the
post digest queue before enabling animations since all $animate-triggered
animation events perform a post digest before running animations.

Closes angular#8844
@matsko matsko force-pushed the fix_ng_animate_no_templates branch from fce672d to b9c9b94 Compare August 29, 2014 19:14
@matsko
Copy link
Contributor Author

matsko commented Aug 29, 2014

MERGED as 9257674

@matsko matsko closed this Aug 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ngAnimate doesn't wait long enough to enable animations on bootstrap
3 participants