I am trying to build a form with a form array, which has multiple drop down menus (all reactive, with value changing according to the option selected in the above select input).
This works pretty well when I am using a regular form group:
<div class="form-group">
<label for="act">Act</label>
<select id="act" formControlName="act" name="act" class="form-control">
<option *ngFor="let act of acts" [value]="act.id">{{act.act.name}}</option>
</select>
</div>
Here the act array changes on valueChanges
of another select option.
However, in a FormArray, this is not working (for obvious reasons, that all nodes of 'act' select option in the FormArray use the same 'act' array).
The options for ACT changes when I select LAW like so:
However, when I select a new value for the second Rule, the ACT options are affected throughout all nodes of the array like so:
Is there any way to provide each FormArray node with a new array of options?
Thank you.