I am using reactive forms in an angular 2+ application and there is a need to pass the main FormGroup to multiple components so that different parts of the form e.g. header, footer etc can be managed in separate components and populated by those different components. This is how I am doing it, at the moment:
<div class="container-fluid">
<form [formGroup]="orderForm">
<order-header [orderForm]="orderForm"></order-header>
<order-items [orderForm]="orderForm"></order-items>
<order-footer [orderForm]="orderForm"></order-footer>
</form>
</div>
I am wondering, if this is a correct approach coz I do see a warning/error with this code:
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'true'. Current value: 'false'.
On this line:
<form [formGroup]="orderForm">
Any suggestions? Thanks.