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, string or number, as specified by the value and sign (positive or negative) of limit
. If a number is used as input, it is converted to a string.
{{ limitTo_expression | limitTo : limit : begin}}
$filter('limitTo')(input, limit, begin)
Param | Type | Details |
---|---|---|
input | Array string number | Source array, string or number to be limited. |
limit | string number | The length of the returned array or string. If the |
begin (optional) | string number | Index at which to begin limitation. As a negative index, |
Array string
|
A new sub-array or substring of length |
© 2010–2016 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.4.14/docs/api/ng/filter/limitTo