Skip to content

Commit ebb325a

Browse files
fix(repeat): Apply $last to the array after $properties have been filtered out
If the $last property is calculated from the original collectionLength on an object and properties starting with $ were filtered out, then $last is never applied and $middle is applied erroniously. This fix uses the length of the filtered array instead. Fixes angular#1789
1 parent 96b9a74 commit ebb325a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ng/directive/ngRepeat.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ var ngRepeatDirective = ngDirective({
149149
childScope.$index = index;
150150

151151
childScope.$first = (index === 0);
152-
childScope.$last = (index === (collectionLength - 1));
152+
childScope.$last = (index === (array.length - 1));
153153
childScope.$middle = !(childScope.$first || childScope.$last);
154154

155155
if (!last) {

0 commit comments

Comments
 (0)