Building template-driven forms
Template-driven forms are one of two different ways of integrating forms with Angular. These can be powerful in cases where we want to create small and simple forms for our Angular application.
We learned about data binding in Chapter 3, Structuring User Interfaces with Components, and how we can use different types to read data from an Angular component and write data to it. In that case, binding is either one way or another, called one-way binding. In template-driven forms, we can combine both ways and create a two-way binding that can read and write data simultaneously. Template-driven forms provide the ngModel
directive, which we can use in our components to get this behavior. To learn more about template-driven forms, we will convert the change price functionality of our product detail component to work with Angular forms.
You will need the source code of the Angular application we created in Chapter 9, Navigating through Applications...