Chapter 8: Orchestrating Validation Experiences in Forms
Web applications use forms when it comes to collecting data from the user. Use cases vary from allowing a user to log in, filling in payment information, booking a flight, or even performing a search. Form data can later be persisted on local storage or be sent to a server using a backend API. A form usually has the following characteristics that enhance the user experience of a web app:
- Can define different kinds of input fields
- Can set up different kinds of validations and display validation errors to the user
- Can support different strategies for handling data in case the form is in an error state
The Angular framework provides two approaches to handle forms: template-driven and reactive. Neither approach is considered better than the other; you just have to go with the one that suits your scenario the best. The main difference between the two approaches is how they manage data:
- Template-driven...