enhancement
The currently implemented DynamicFormBuilder cannot be used directly as a FormBuilder due to several issues:
- Although it implements ModelBuilder, it creates a FormGroup in getModel(..) and returns it. However, in the EditComponent or FormComponent, the createFormContext(..) method explicitly performs a hard cast to FormContext. This consequently leads to a ClassCastException.
- The constructor expects a `contextType` and `contextModel` as arguments. `contextType` is not used anywhere, so it appears to be superfluous. `contextModel` is used in the place where the component’s model should be used. Furthermore, the component’s model is used as `contextType`. This makes no sense.
- Currently, the `DynamicFormBuilder` is used in three places, all of which only require a `FormGroup` and not a `FormBuilder`; therefore, it would suffice to extract the necessary code for creating the `FormGroup` into a utility method.
Test
No test.