0

I am clone a object like below since if I do some operation in the parent component the child component is getting triggered which should not be the case so cloning the object.

result is the data which is emitted from child as FormGroup in parent component trying to clone it. the clone works but if i try to get the properties of FormGroup gives as undefined.

 let form=Object.assign({},result);

form.get('somename');
Veera
  • 101
  • 1
  • 4
  • There is not enough information here. Is result something like form.value? – MikeOne Apr 03 '22 at 16:11
  • not form value, it is FormGroup which contains all the controls in it @Mikeone – Veera Apr 03 '22 at 16:26
  • Yeah, that’s not really the right approach. See this: https://stackoverflow.com/questions/34504682/js-does-object-assign-create-deep-copy-or-shallow-copy – MikeOne Apr 03 '22 at 19:55

0 Answers0