A namespace for utility functions for the manipulation of JavaScript Array objects.
These functions are exposed in two ways:
Angular expressions: Functions are bound to the Array objects and augment the Array type
as array methods. The names of these methods are prefixed with the $
character to minimize
naming collisions. To call a method, invoke myArrayObject.$foo(params).
Because Array type is a subtype of the Object type, all angular.Object functions augment the Array type in Angular expressions as well.
JavaScript code: Functions do nor augment the Array type and must be invoked as functions
of angular.Array
as angular.Array.foo(myArrayObject, params)
.
The following APIs are built in to the Angular Array object:
angular.Array.add()
- Optionally adds a new element to an array.angular.Array.count()
- Determines the number of elements in an
array.angular.Array.filter()
- Returns the subset of elements specified
in the filter as a new array.angular.Array.indexOf()
- Determines the index of an array
value.angular.Array.limitTo()
- Creates a sub-array of an existing
array.angular.Array.orderBy()
- Orders array elements.angular.Array.remove()
- Removes array elements.angular.Array.sum()
- Sums the numbers in an array.