0

I manage to add data by filling in the form fields.

But when I want to modify the added values enter image description here

I manage to fill all the fields with the data of the selected item except for the check boxes checked at the time of insertion (the selected months or letters).enter image description here enter image description here

I also have the following error:

ERROR Error: NG01002: Must supply a value for form control at index: 0

Here is the link to the typescript component: https://github.com/hermann-dev-10/app-admin-num/blob/main/src/app/components/dialog/dialog.component.ts

Here is also the HTML code of the component in question : https://github.com/hermann-dev-10/app-admin-num/blob/main/src/app/components/dialog/dialog.component.html

I think the problem comes from the fact that I am using formArrayName, I don't really see how to solve this so that the relevant checkboxes are checked, depending on the workbook I want to update.

Would you know where the problem could come from?

I thank you in advance for your help

Hermann
  • 21
  • 6
  • Using ".patchValue" I manage to fill in checkboxes but it doesn't select the right ones... instead of the "setValue" – Hermann Sep 05 '22 at 14:45
  • I have found an example of what I would like to achieve approximately : https://www.tektutorialshub.com/angular/setvalue-patchvalue-in-formarray-angular/ – Hermann Sep 05 '22 at 14:56
  • So I manage to check the checkboxes using ".patchValue()" but it doesn't necessarily check the right boxes... – Hermann Sep 05 '22 at 15:23

0 Answers0