Skip to content
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
@lukehorvat

Description

@lukehorvat

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions