I try to create a reactive form of this kind:
(o) Some radio button
( ) Another radio button
[ ] A nested checkbox, disabled as long "Another radio button" is not selected
[ ] Another checkbox, disabled as long "Another radio button" is not selected
The checkboxes are disabled in the state shown above. If the second radio button is activated, the checkboxes can also be selected.
How do I model that in Angular.io with reactive forms? One could view it as a single control, with values:
- artificial value representing selection of first radio button
- value of first checkbox
- value of second checkbox
Another way would be that it is a boolean FormControl, but in case of one value another FormControl is added below, but I don't think this is possible.
What is the best way to model that in reactive forms logic?