diff options
Diffstat (limited to 'src/ng/directive/ngRepeat.js')
| -rw-r--r-- | src/ng/directive/ngRepeat.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index 66464c1b..d5d3a64c 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -12,10 +12,9 @@ * Special properties are exposed on the local scope of each template instance, including: * * * `$index` – `{number}` – iterator offset of the repeated element (0..length-1) - * * `$position` – `{string}` – position of the repeated element in the iterator. One of: - * * `'first'`, - * * `'middle'` - * * `'last'` + * * `$first` – `{boolean}` – true if the repeated element is first in the iterator. + * * `$middle` – `{boolean}` – true if the repeated element is between the first and last in the iterator. + * * `$last` – `{boolean}` – true if the repeated element is last in the iterator. * * * @element ANY @@ -145,9 +144,10 @@ var ngRepeatDirective = ngDirective({ childScope[valueIdent] = value; if (keyIdent) childScope[keyIdent] = key; childScope.$index = index; - childScope.$position = index === 0 ? - 'first' : - (index == collectionLength - 1 ? 'last' : 'middle'); + + childScope.$first = (index === 0); + childScope.$last = (index === (collectionLength - 1)); + childScope.$middle = !(childScope.$first || childScope.$last); if (!last) { linker(childScope, function(clone){ |
