forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.Array.remove.html
35 lines (34 loc) · 1.5 KB
/
angular.Array.remove.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<h1>angular.Array.remove</h1>
<div class="angular-array-remove"><h2>Description</h2>
<div class="description"><p>Modifies <code>array</code> by removing an element from it. The element will be looked up using the
<a href="#!angular.Array.indexOf"><code>indexOf</code></a> function on the <code>array</code> and only the first instance of
the element will be removed.</p>
<p>Note: this function is used to augment the <code>Array</code> type in angular expressions. See
<a href="#!angular.Array"><code>angular.Array</code></a> for more info.</p></div>
<h2>Dependencies</h2>
<ul class="dependencies"></ul>
<h2>Usage</h2>
<div class="usage"><div ng:non-bindable=""><pre class="brush: js; html-script: true;">angular.Array.remove(array, value);</pre>
</div>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">array – {Array} – </code>
<p>Array from which an element should be removed.</p></li>
<li><code ng:non-bindable="">value – {*} – </code>
<p>Element to be removed.</p></li>
</ul>
<h3>Returns</h3>
<div class="returns"><code ng:non-bindable="">{*}</code>
– <p>The removed element.</p></div>
</div>
<h2>Example</h2>
<div class="example"><doc:example><doc:source><ul ng:init="tasks=['Learn Angular', 'Read Documentation',
'Check out demos', 'Build cool applications']">
<li ng:repeat="task in tasks">
{{task}} [<a href="" ng:click="tasks.$remove(task)">X</a>]
</li>
</ul>
<hr/>
tasks = {{tasks}}</doc:source>
</doc:example>
</div>
</div>