fix($compile): set the iteration state before linking

This issue was introduced in b87e5fc092.
The state for each row has to be set up *before* linking.

The cloneFn (the function passed into $transclude) is called *before* actual linking and thus it is enough to update the state inside the cloneFn callback.
This commit is contained in:
Vojta Jina
2014-05-27 15:02:54 -07:00
parent 2ee29c5da8
commit 0c8a2cd2da
2 changed files with 17 additions and 1 deletions

View File

@@ -360,6 +360,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
$animate.move(getBlockElements(block.clone), null, jqLite(previousNode));
}
previousNode = getBlockEnd(block);
updateScope(block.scope, index);
} else {
// new item which we don't know about
$transclude(function(clone, scope) {
@@ -372,9 +373,9 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
// by a directive with templateUrl when it's template arrives.
block.clone = clone;
nextBlockMap[block.id] = block;
updateScope(block.scope, index);
});
}
updateScope(block.scope, index);
}
lastBlockMap = nextBlockMap;
});