add
is a function similar to JavaScript's Array#push
method, in that it appends a new
element to an array. The difference is that the value being added is optional and defaults to
an empty object.
Note: this function is used to augment the Array
type in angular expressions. See
angular.Array
for more info.
angular.Array.add(array[, value]);
array – {Array} –
The array expand.
value(optional={}) – {*} –
The value to be added.
{Array}
– The expanded array.
This example shows how an initially empty array can be filled with objects created from user
input via the $add
method.