Building template-driven forms
In this section, we will build a template-driven form. You will learn how to bind data to input fields, group form fields, and perform built-in and custom validation rules in template-driven forms. You will also learn how template-driven forms work behind the scenes to get a better understanding of template-driven forms.
By the end of this section, you’ll be able to build robust template-driven forms and create a template-driven form to add expenses to our demo application.
Creating a forms library with a form component
Before we start creating the form, we need a new library. We will generate the new library using the custom Nx generator we made in Chapter 1.
You can debate about how to separate the forms library. You can either create one library that holds all the forms of a specific domain, you can create a forms library for each application in a particular domain, or you can create a new library for each form.
Using a single...