Skip to content

Commit

Permalink
fix($animate): do not throw errors if element is removed before anima…
Browse files Browse the repository at this point in the history
…tion starts

Closes angular#10205
  • Loading branch information
matsko committed Aug 17, 2015
1 parent 51e24d7 commit f315efd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ngAnimate/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,9 +1194,12 @@ angular.module('ngAnimate', ['ng'])
}

return cache.promise = runAnimationPostDigest(function(done) {
var parentElement = element.parent();
var elementNode = extractElementNode(element);
var parentNode = elementNode.parentNode;
var parentNode, parentElement, elementNode = extractElementNode(element);
if (elementNode) {
parentElement = element.parent();
parentNode = elementNode.parentNode;
}

// TODO(matsko): move this code into the animationsDisabled() function once #8092 is fixed
if (!parentNode || parentNode['$$NG_REMOVED'] || elementNode['$$NG_REMOVED']) {
done();
Expand Down

0 comments on commit f315efd

Please sign in to comment.