mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-10 09:09:46 +08:00
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:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user