Reactive Form
Reactive forms offer the ease of using reactive patterns, testing, and validation.
You create and manipulate form control objects directly in the component class.
As the component class has immediate access to both the data model and the form control structure, you can push data model values into the form controls and pull user-changed values back out.
The component can observe changes in form control state and react to those changes.
Immutability of the data model
In keeping with the reactive paradigm, the component preserves the immutability of the data model, treating it as a pure source of original values.
Rather than update the data model directly, the component extracts user changes and forwards them to an external component or service, which does something with them (such as saving them) and returns a new data model to the component that reflects the updated model state.
A FormControl constructor accepts three, optional arguments:
the initial data value
an array of validators
an array of async validators
Fundamental Class
Last updated
Was this helpful?