Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 1.3.14 merge(dst) does not exist

I am baffled by this one. In the angular api and on github there is a merge function which does a deep merge on two objects, unlike extend() which does a shallow copy.

I use google's cdn for angular, and call angular.extend('param') works, but calling angular.merge('param') gives undefined function. Comparing the angular.js from google and the one from angular them selves, merge does exist on the angular one, but not in google.

Any ideas, or someone else with this problem. Could I let google know somehow?

like image 881
Gerardlamo Avatar asked Mar 11 '15 07:03

Gerardlamo


1 Answers

Feel like a fool, it is only available in the beta version 1.4 Hope this still is able to help someone who is wondering as well. :)

Also copied it from the latest version:

//Leave out the {} to directly change src
function merge(src, newObj) {
   return angular.extend({},src, newObj);
}
like image 197
Gerardlamo Avatar answered Oct 15 '22 02:10

Gerardlamo