1

I want to share form value in angular.

There is a FormGroup defined in main-component. This is used in aaa/bbb-component.

I want to reflect the contents entered in the textarea of aaa-component to the textarea of bbb-component. Is there any method?


Source code is available on stackblitz.

Angular: 8.2.14

otera
  • 432
  • 5
  • 17
  • 2
    Basically you want to share data between components, this has been already [answered](https://stackoverflow.com/a/53844631/11719787), If your question is different from this, please explain what you have tried and post the source code here, BTW the link you have provided is dead – Sameer Jan 21 '20 at 06:00

1 Answers1

0

@otera I'm not sure what you need. But change the Textarea HTML to the desired output.

Note - Add value [value]="item.value" tag in both aaa/bbb-component HTML files.

<textarea [formControlName]="i" rows="5" [value]="item.value"></textarea>