Forms
Angular 4 supports creating forms using techniques such as template-driven forms, reactive forms (also termed as model-driven forms), and dynamic forms. In this section, we shall quickly go through some of the important aspects of each technique, and when can they be used.
The following are some key aspects of form handling that shall be dealt with while creating forms using different techniques:
- Creating form controls such as input elements such as text fields, dropdowns, and so on
- Binding form controls with the associated data
- Creating appropriate validations rules, and displaying validation message appropriately for one or more form controls based on business rules
- Conditionally enabling or disabling one or more form controls such as input fields
- Interacting with the backend for data processing
- Submitting data to the backend
- Retrieving responses from the backend and displaying them on the UI appropriatelyÂ
Template-driven forms
Template-driven forms are created using templates based on the...