Template-driven forms – important modules

Armed with knowledge about the pros and cons of using the template-driven approach, without wasting any time we will deep dive into learning how to implement the template-driven forms in our application. We will start by learning about the required modules and gradually progress to create forms in our application. As explained in the preceding sections, template-driven forms are mostly defined in the template file. Before we jump into creating examples of template-driven forms, we should understand some of the most important concepts related to forms, namely, ngForm and ngModel:

  • ngForm: This is the directive that helps to create the control groups inside the form directive
  • ngModel: When ngModel is used on elements inside ngForm, all the elements and data get registered inside ngForm
If the Angular form is using ngForm and ngModel, it means that the form is template-driven.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.206.8