Im using igx checkbox in my angular reactive form how to use them in angular 10
Hi Ravikiran,
Here you can find a sample with two IgxCheckboxes in reactive form in Angular 10.
Please let us know if any additional questions on this matter arise.
Hi Milko,
Thank you for the prominent response but the answer shows the form group and its attachment with the separate "igx-checkbox".
I actually need to iterate the checkbox and along with dynamic parameters which will be compatible while using "formArray" which will eventually return the array of controls dynamically and with the selected value and a boolean which will indicate its check (true/ false).
Kindly share your views for the same...
Thanking,
Ravikiran Niturkar
Hello Ravikiran,
If you want to iterate trough formArray, you can access its controls property, which is an array of AbstractControl objects. You can refer to the official documentation of FormArray here.
Be aware that you can have FormArray or FormGroup objects inside the FormArray, because there can be nesting.
Here is a simple example:
for (let control of formArray.controls) { if (control instanceof FormControl) { // is a FormControl } if (control instanceof FormGroup) { // is a FormGroup } if (control instanceof FormArray) { // is a FormArray } }
The example above that Milko listed shows how to use igx-checkbox in a reactive form. If you need more help on reactive forms, we would suggest checking the angular documentation for further reference at angular.io/.../reactive-forms.
Sincerely,Tihomir TonevAssociate Software DeveloperInfragistics