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
Description
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).