fix(ngRepeat): preserve original position of elements that are being animated away

During the recent refactoring a typo was made that broke code that detects if we are
already removed from the DOM (animation has completed).

Closes #8918
Closes #8994
This commit is contained in:
Igor Minar
2014-09-09 02:52:36 +02:00
parent f33a938545
commit ed63733000
2 changed files with 39 additions and 3 deletions

View File

@@ -379,7 +379,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
block = lastBlockMap[blockKey];
elementsToRemove = getBlockNodes(block.clone);
$animate.leave(elementsToRemove);
if (elementsToRemove[0].parent) {
if (elementsToRemove[0].parentNode) {
// if the element was not removed yet because of pending animation, mark it as deleted
// so that we can ignore it later
for (index = 0, length = elementsToRemove.length; index < length; index++) {