Angularjs Examples

AJS Examples


AngularJS Merge Function

Sometimes you may require to create deep copy of one or more source object into the destination object. AngularJS merge function is similar to extend function unlike extend(), merge() recursively descends into object properties of source objects, performing a deep copy. It's function takes destination object and one or more source object that you want to copy into destination object var object = angular.merge({}, obj1, obj2).

NOTE: angular.copy() is slower than angular.extend()

Syntax

AngularJS Merge Function Example

See Live Example