From 4568bc037d3a71fcad00692d7f91f7aa89dbbc33 Mon Sep 17 00:00:00 2001 From: Warlock Date: Mon, 15 Sep 2014 13:03:35 +0400 Subject: [PATCH] docs: update angular.extend() documentation How to preserve original objects similar to jQuery.extend(). Closes #9087 --- src/Angular.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Angular.js b/src/Angular.js index 2e37d892..35f46889 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -334,6 +334,9 @@ function setHashKey(obj, h) { * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s) * to `dst`. You can specify multiple `src` objects. * + * You can specify multiple `src` objects. If you want to preserve original objects, you can do so + * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`. + * * @param {Object} dst Destination object. * @param {...Object} src Source object(s). * @returns {Object} Reference to `dst`.