aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngAnimate/animate.js
diff options
context:
space:
mode:
authorMatias Niemelä2013-07-25 21:19:20 -0400
committerMisko Hevery2013-07-26 23:49:54 -0700
commite31104fa6c9e5efd93ac69cd70c70cffaf200843 (patch)
tree14c40836499eead7a065c875e4046056d4e8ed15 /src/ngAnimate/animate.js
parent15389b0e377e2a84b85178e993e4940d8098d0ed (diff)
downloadangular.js-e31104fa6c9e5efd93ac69cd70c70cffaf200843.tar.bz2
fix($animate): make animation onComplete callbacks async
Diffstat (limited to 'src/ngAnimate/animate.js')
-rw-r--r--src/ngAnimate/animate.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js
index 28d36629..7eef1c34 100644
--- a/src/ngAnimate/animate.js
+++ b/src/ngAnimate/animate.js
@@ -203,8 +203,8 @@ angular.module('ngAnimate', ['ng'])
var NG_ANIMATE_STATE = '$$ngAnimateState';
var rootAnimateState = {running:true};
- $provide.decorator('$animate', ['$delegate', '$injector', '$sniffer', '$rootElement',
- function($delegate, $injector, $sniffer, $rootElement) {
+ $provide.decorator('$animate', ['$delegate', '$injector', '$sniffer', '$rootElement', '$timeout',
+ function($delegate, $injector, $sniffer, $rootElement, $timeout) {
var noop = angular.noop;
var forEach = angular.forEach;
@@ -463,7 +463,8 @@ angular.module('ngAnimate', ['ng'])
if ((parent.inheritedData(NG_ANIMATE_STATE) || disabledAnimation).running) {
//avoid calling done() since there is no need to remove any
//data or className values since this happens earlier than that
- (onComplete || noop)();
+ //and also use a timeout so that it won't be asynchronous
+ $timeout(onComplete || noop, 0, false);
return;
}