forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.Array.limitTo.html
22 lines (21 loc) · 1.15 KB
/
angular.Array.limitTo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<h1>angular.Array.limitTo</h1>
<fieldset class="workInProgress"><legend>Work in Progress</legend>
This page is currently being revised. It might be incomplete or contain inaccuracies.</fieldset>
<h2>Description</h2>
<p>Creates a new array containing only the first, or last <code>limit</code> number of elements of the
source <code>array</code>.</p>
<p>Note: this function is used to augment the Array type in angular expressions. See
<a href="#!angular.Array"><code>angular.Array</code></a> for more info.</p><h2>Usage</h2>
<div ng:non-bindable=""><pre class="brush: js; html-script: true;">angular.Array.limitTo(array, limit);</pre>
</div>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">array – {Array} – </code>
Source array to be limited.</li>
<li><code ng:non-bindable="">limit – {string|Number} – </code>
The length of the returned array. If the number is positive, the
first <code>limit</code> items from the source array will be copied, if the number is negative, the
last <code>limit</code> items will be copied.</li>
</ul>
<h3>Returns</h3>
<code ng:non-bindable="">Array</code>
– New array of length <code>limit</code>.