kendo-angular
kendo-angular copied to clipboard
Creating radio buttons with *ngFor on an Observable, throws an error when using FormField component
Though this is definitely better, it still has a problem. If the radio buttons are dynamically created via an observable, the list that they relate to will initially be empty until such time that the observable returns a list of values from a call to an API (say). With an empty list, the isControlGroup(formControls) function returns false, and an exception is thrown.
Hiding or showing the radio button group might be an option, though I suspect that this will bypass any form validation.
Originally posted by @jrdutton in https://github.com/telerik/kendo-angular/issues/3365#issuecomment-895112813
The scenario could be handled by creating the FormField only after the data for the radio buttons had arrived, something like:
https://stackblitz.com/edit/angular-jofpzb-imsxrp?file=src%2Fapp%2Fapp.component.ts
As this repo is for bug reports only, for further questions related to scenario- or implementation-specific issues, please open a support ticket.