Here we dive further into Angular, and especially how forms are used in single page applications. There comes a time when you must submit your form data to some backend server, and Angular offers two approaches to meet this need. You will be learning the Angular way of dealing with data submission, validation, capturing submitted values, and some powerful features of Angular forms over the course of this chapter. We will cover:
- Two approaches to forms:
- Template-driven forms
- Reactive forms
- Understanding forms with an example
- Building custom forms with validations
- Checking the state of a form
- Forms with NgModel
- Reactive forms:
- Setting up forms with FormBuilder
- Adding validations
- Creating a custom validator
- Grouping controls
- Setting and patching values
- Handling forms in Angular
- Gaining more control with Reactive Forms