Creates a deep copy of source
, which should be an object or an array.
source
is not an object or array (inc. null
and undefined
), source
is returned.source
is identical to 'destination' an exception will be thrown.angular.copy(source, [destination]);
Param | Type | Details |
---|---|---|
source | * | The source that will be used to make a copy. Can be any type, including primitives, |
destination (optional) | Object Array | Destination into which the source is copied. If provided, must be of the same type as |
* |
The copy or updated |
© 2010–2016 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.4.14/docs/api/ng/function/angular.copy