Enhancement
The currently implemented DynamicFormBuilder is not directly usable as FormBuilder due to several problems:
- It implements ModelBuilder, but creates a FormGroup in getModel(..), which it also returns. However, in the EditComponent or FormComponent in the createFormContext(..) method, it explicitly hard-casts to FormContext. This consequently leads to a ClassCastException.
- The constructor expects a contextType`and `contextModel as arguments. contextType is not used at any point, so it is apparently superfluous. contextModel is used at the point where the component's model should be used. Furthermore, the model of the component is used as contextType. This makes no sense.
- Currently the DynamicFormBuilder is used in three places, which again only need the FormGroup and no FormBuilder, so it would be sufficient to manufacture the required code to create the FormGroup in a utility method.
Test
No test.