-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RxFormArray setValue #524
Comments
@VoteForPedro How you are creating the nested FormGroup? please share the little bit code snippet. |
|
@VoteForPedro uses the push method of 'RxFormArray'. here is the example: var eqs = (this.form.get("equipments") as RxFormArray);
result.equipments.forEach((a) => eqs.push(this.formBuilder.formGroup(new EquipmentViewModel(a)))); |
@ajayojha yes, im already using push. But how can i replace an array of existing controls? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to replace existing formarray controls?
I have RxFormArray that is empty, When im receiving data, im trying to set it to form array:
`
var eqs = (this.form.get("equipments") as RxFormArray);
let items = result.equipments.map((a) => this.formBuilder.formGroup(new EquipmentViewModel(a)));
eqs.setValue(items);
`
setValue function call throws error:
There are no form controls registered with this array yet. If you're using ngModel,
you may want to check next tick (e.g. use setTimeout).
@rxweb/reactive-form-validators: "2.1.4"
The text was updated successfully, but these errors were encountered: