This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngRepeat: $previous and $next #9740
Open
Description
ngRepeat currently exposes a few handy (but not 100% necessary) scope properties like $last
and $odd
. It would be nice to also have $previous
(the previous collection item) and $next
(the next collection item). Many times I've needed to render a "difference" value for the current item and the previous/next one, and I've had to resort to reaching back into the collection using $index ± 1
, which isn't as readable. It's a common feature in iterator implementations.