aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets.js
diff options
context:
space:
mode:
authorMisko Hevery2011-06-22 14:30:56 -0700
committerIgor Minar2011-06-23 08:12:01 -0700
commit9ec45ad5c45791c81d4d1909ea1abceedc5ed3e9 (patch)
tree0e23535f4388c5bbdc5c183cbfe4e1e558fe4d38 /src/widgets.js
parent8e880fcb77bdcca2fd4a25f1333acc45dca75d8b (diff)
downloadangular.js-9ec45ad5c45791c81d4d1909ea1abceedc5ed3e9.tar.bz2
fix:ng:repeater - fix $position when collection size changes
Diffstat (limited to 'src/widgets.js')
-rw-r--r--src/widgets.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets.js b/src/widgets.js
index a9d42bdf..392771e3 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -1143,6 +1143,9 @@ angularWidget('@ng:repeat', function(expression, element){
childScope[valueIdent] = collection[key];
if (keyIdent) childScope[keyIdent] = key;
lastIterElement = childScope.$element;
+ childScope.$position = index == 0
+ ? 'first'
+ : (index == collectionLength - 1 ? 'last' : 'middle');
childScope.$eval();
} else {
// grow children