'FormGroup: Dynamic input type breaks value attribute binding

It took me a couple days, but I narrowed it down to the type attribute. In my StackBlitz, the first radio set is just putting an empty string in the FormGroup object. To fix it, just change line 9 from [type]="question.type" to type="radio".

Is there another attribute I should be using to do dynamic input types? (I wanted to try to do checkboxes and radio buttons in the same pass of a larger ngSwitch.)

Here is my StackBlitz.

Update: Looks like it's a bug that isn't getting fixed and we should use ngSwitch / ngIfs instead.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source