javascript - Angular2: JQuery $.extend for Angular2/4 -
how can use jquery $.extend in angular2 without using jquery?
i try use object.assign deep merging not work.
an example here: https://codepen.io/anon/pen/nvgpov
object.assign( baseoptions, customoption);
angular 2/4 not provide way perform deep copy. not offer opinion or implementation on deep copy of javascript objects.
if object not contain functions or date objects below approach using pure javascript way can work in cases:
var clonedobject = json.parse(json.stringify(obj));
once object cloned, can assign additional properties it.
Comments
Post a Comment