0

I think this question isn't new for someone but I didn't find a simply solution. I have 2 components, a parent that defines an object 'x' with inside another object 'y' (x.y). It passes the object 'y' to the child

<child [obj]="x.y"></child>

Suppose that into the child component I have an input text that edit y.myStr. When I change this value, from the parent component the value of x.y.myStr didn't change.

Why this? I read that object and array are passed by reference.

Could someone help me?

Thanks Fabrizio

Fabrizio P
  • 241
  • 3
  • 13

0 Answers0