Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4568bc0

Browse files
ddoroninIgorMinar
authored andcommitted
docs: update angular.extend() documentation
How to preserve original objects similar to jQuery.extend(). Closes #9087
1 parent e07ebde commit 4568bc0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Angular.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ function setHashKey(obj, h) {
334334
* Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
335335
* to `dst`. You can specify multiple `src` objects.
336336
*
337+
* You can specify multiple `src` objects. If you want to preserve original objects, you can do so
338+
* by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.
339+
*
337340
* @param {Object} dst Destination object.
338341
* @param {...Object} src Source object(s).
339342
* @returns {Object} Reference to `dst`.

0 commit comments

Comments
 (0)