Try using
this.user = Object.assign({}, currentObject);
As mentioned by @AngularFrance, this will only work for shallow-copying objects, seek another implementation if there’s a need to deep-copy an object.
Try using
this.user = Object.assign({}, currentObject);
As mentioned by @AngularFrance, this will only work for shallow-copying objects, seek another implementation if there’s a need to deep-copy an object.