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.

limitTo: Ignore limit when undefined #10484

Closed
@gkalpak

Description

@gkalpak

Currently, passing an undefined limit to the limitTo filter will return an empty array/string.
I would expect filtering to be skipped and the original input returned, when the limit argument is undefined.

E.g.:

Limit: <input type="number" ng-model="limit" />
Items: <ul><li ng-repeat="item in items | limitTo:limit">...</li></ul>

Before interacting with the input (i.e. explicitly specifying a limit), I would expect all items to be listed.
What happens instead, is that no item is listed, until a valid integer number is specified.

Although there are ways around this limitation (i.e. detecting undefined and set limit to Infinity), they are unnecessrily verbose (imo).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions