mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-16 02:33:09 +00:00
docs for angular.extend
This commit is contained in:
parent
17eee57c52
commit
921f7ce49e
1 changed files with 14 additions and 0 deletions
|
|
@ -611,6 +611,19 @@ function formatError(arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @workInProgress
|
||||||
|
* @ngdoc function
|
||||||
|
* @name angular.extend
|
||||||
|
* @function
|
||||||
|
*
|
||||||
|
* @description
|
||||||
|
* Extends the destination object `dst` by copying all of the properties from the `src` objects to
|
||||||
|
* `dst`. You can specify multiple `src` objects.
|
||||||
|
*
|
||||||
|
* @param {Object} dst The destination object.
|
||||||
|
* @param {...Object} src The source object(s).
|
||||||
|
*/
|
||||||
function extend(dst) {
|
function extend(dst) {
|
||||||
foreach(arguments, function(obj){
|
foreach(arguments, function(obj){
|
||||||
if (obj !== dst) {
|
if (obj !== dst) {
|
||||||
|
|
@ -622,6 +635,7 @@ function extend(dst) {
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function inherit(parent, extra) {
|
function inherit(parent, extra) {
|
||||||
return extend(new (extend(function(){}, {prototype:parent}))(), extra);
|
return extend(new (extend(function(){}, {prototype:parent}))(), extra);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue