i need the values in a dynamic form but always show me this error "ERROR Error: control.registerOnChange is not a function"
i build my form like this:
referential.values.forEach(referentialValue => {
const newFormGroup = new FormGroup({
value: new FormControl(referentialValue.value),
libelle: new FormControl(referentialValue.libelle),
primaryColor: new FormControl(referentialValue.primaryColor),
secondaryColor: new FormControl(referentialValue.secondaryColor),
borderColor: new FormControl(referentialValue.borderColor),
default: new FormControl('')
});
this.referentialArray.push(newFormGroup);
});
this.form = new FormGroup({
referentials: this.referentialArray
});
this.form.disable();
and the html (not whole):
<tbody formArrayName="referentials">
<tr *ngFor="let referential of referentialArray.controls; let i = index">
<td><input type="text"
[formControlName]="i"></td>
<td><input type="text"
[formControlName]="i"></td>
any ideas?