angular.Array.remove

Description

Modifies array by removing an element from it. The element will be looked up using the indexOf function on the array and only the first instance of the element will be removed.

Note: this function is used to augment the Array type in angular expressions. See angular.Array for more info.

Dependencies

Usage

angular.Array.remove(array, value);

Parameters

Returns

{*}

The removed element.

Example

<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}}