Creating reactive forms in Ionic

In the previous example, we have created a complex form with validations. If you notice carefully, we used angular validations inside our template file, particularly in home.html. These type of forms are called as template driven form, where most of the work is done on template side. This is something very similar to what we had in AngularJS.

There is another type of form in Angular, called the reactive form. The difference is, in reactive forms, we used validations and other configuration inside the class of the component, instead of in the template. The following is the definition from Angular Docs:

"With reactive forms, you create a tree of Angular form control objects in the component class and bind them to native form control elements in the component template."

We will create a registration form, which looks like the following:

..................Content has been hidden....................

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