9 Forms

This chapter covers

  • Creating forms using Angular’s forms libraries
  • Deciding between using Reactive or Template forms
  • Validating forms with custom logic
  • Accessing data and watching input changes
  • Submitting form data and handling errors gracefully
  • Creating custom form controls

Just about every application uses forms in some way, if only to do something simple like log in or manage settings. HTML comes with a number of form elements by default, such as inputs, selects, and buttons, and Angular provides a way to use these native elements and add some power to them. We’ve used forms in several previous examples, but in this chapter we’ll dig into them much more completely.

Angular provides two approaches to building forms: reactive ...

Get Angular in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.