From 5dcc9e204702eaaa40e6f09d99e74c74fb026a56 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 2 Jun 2015 13:22:40 -0700 Subject: [PATCH] Add `angular.merge` function This is new API in Angular 1.4: https://docs.angularjs.org/api/ng/function/angular.merge --- angularjs/angular.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 009af202a8..0e54c2aea8 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -249,6 +249,16 @@ declare module angular { isString(value: any): boolean; isUndefined(value: any): boolean; lowercase(str: string): string; + + /** + * Deeply extends the destination object dst by copying own enumerable properties from the src object(s) to dst. 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.merge({}, object1, object2). + * + * Unlike extend(), merge() recursively descends into object properties of source objects, performing a deep copy. + * + * @param dst Destination object. + * @param src Source object(s). + */ + merge(dst: any, ...src: any[]): any; /** * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism.