diff options
| author | Matias Niemelä | 2013-11-25 13:40:52 -0500 |
|---|---|---|
| committer | Matias Niemelä | 2013-11-25 15:00:50 -0500 |
| commit | eed2333298412fbad04eda97ded3487c845b9eb9 (patch) | |
| tree | ae9083ec8582ea7c93e5c9fbcd8e393d0aa0748d /src | |
| parent | a2809dacc44c14513e5a7737865ce682964ffe7e (diff) | |
| download | angular.js-eed2333298412fbad04eda97ded3487c845b9eb9.tar.bz2 | |
fix(ngAnimate): ensure animations are disabled upon bootstrap for structrual animations
Closes #5130
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngAnimate/animate.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index fde8a7fa..f31932dc 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -263,9 +263,16 @@ angular.module('ngAnimate', ['ng']) $rootElement.data(NG_ANIMATE_STATE, rootAnimateState); - // disable animations during bootstrap, but once we bootstrapped, enable animations + // disable animations during bootstrap, but once we bootstrapped, wait again + // for another digest until enabling animations. The reason why we digest twice + // is because all structural animations (enter, leave and move) all perform a + // post digest operation before animating. If we only wait for a single digest + // to pass then the structural animation would render its animation on page load. + // (which is what we're trying to avoid when the application first boots up.) $rootScope.$$postDigest(function() { - rootAnimateState.running = false; + $rootScope.$$postDigest(function() { + rootAnimateState.running = false; + }); }); function lookup(name) { |
