问题
In code below
<div *ngSwitchCase="'arraytext'" >
<label class="col-sm-6" [formArrayName]="question.key" *ngFor="let order of form.controls.options.controls; let i = index">
<input type="checkbox" [formControlName]="i" class="form-control">{{order.value}}
</label>
</div>
Here options is checkbox input for dynamic form and for another checkbox input may be option-2.
So my question is how to have form.controls.options.controls dynamic instead of using hard-coded options
Demo. Here I managed to get the checkbox values, but the problem is how to have more than one checkbox. form.controls.options.controls is hard coded
来源:https://stackoverflow.com/questions/58010831/use-for-dynamic-object-property-names-in-angular-reactive-form