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 $ 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 theArray type in angular expressions as well.
JavaScript code: Functions don't 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 a subset of items as a new array.angular.Array.indexOf()
- Determines the index of an array value.angular.Array.limitTo()
- Creates a new array off the front or
back of an existing array.angular.Array.orderBy()
- Orders array elementsangular.Array.remove()
- Removes array elementsangular.Array.sum()
- Sums the number elements in an array