limitTo
(filter in module ng
)
Creates a new array containing only a specified number of elements in an array. The elements
are taken from either the beginning or the end of the source array, as specified by the
value and sign (positive or negative) of limit.
Note: This function is used to augment the Array type in Angular expressions. See
ng.$filter for more information about Angular arrays.
filter:limitTo(array, limit);
array – {Array} –
Source array to be limited.
limit – {string|Number} –
The length of the returned array. If the limit number is
positive, limit number of items from the beginning of the source array are copied.
If the number is negative, limit number of items from the end of the source array are
copied. The limit will be trimmed if it exceeds array.length
{Array}
– A new sub-array of length limit or less if input array had less than limit
elements.