kendo-angular icon indicating copy to clipboard operation
kendo-angular copied to clipboard

Creating radio buttons with *ngFor on an Observable, throws an error when using FormField component

Open jrdutton opened this issue 3 years ago • 1 comments

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

jrdutton avatar Aug 10 '21 08:08 jrdutton

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.

dtopalov avatar Oct 06 '22 06:10 dtopalov