Chapter 7. Working with forms

This chapter covers

  • Understanding the Angular Forms API (NgModel, FormControl, FormGroup, form directives, FormBuilder)
  • Working with template-driven forms
  • Working with reactive forms
  • Understanding form validation

Angular offers rich support for handling forms. It goes beyond regular data-binding by treating form fields as first-class citizens and providing fine-grained control over form data.

This chapter will start by demonstrating how you can implement a sample user registration form in pure HTML. While working on this form, we’ll briefly discuss the standard HTML forms and their shortcomings. Then you’ll see what the Angular Forms API brings to the table, and we’ll cover the template-driven and reactive ...

Get Angular 2 Development with TypeScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.