Improve this Doc View Source limitTo
- filter in module ng
Creates a new array or string containing only a specified number of elements. The elements are taken from either the beginning or the end of the source array or string, as specified by the value and sign (positive or negative) of limit
.
Usage
In HTML Template Binding
{{ limitTo_expression | limitTo : limit}}
In JavaScript
$filter('limitTo')(input, limit)
Arguments
Param | Type | Details |
---|---|---|
input | Array string | Source array or string to be limited. |
limit | string number | The length of the returned array or string. If the |
Returns
Array string
|
A new sub-array or substring of length |
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.2.32/docs/api/ng/filter/limitTo