Basically I have two arrays, and I would like to store their values at the same time using a *ngFor
, I did something like this just to show what I would expect:
I think your issue is here:
addAlternativeField() {
this.alternativeFields.push(this.fbuilder.control(''));
this.alternativeFieldsValues.push(this.fbuilder.control(''));
}
You are patching the arrays in direct reference to this. Isn't it supposed to be
this.form.get('alternativeFields').push(this.fbuilder.control(''))
Or do you have an additional getter?