July 2018
Intermediate to advanced
420 pages
8h 46m
English
A very good example to understand model-driven forms is the register form. Let's look at register.component.html and register.component.ts:
Open ./Client/src/app/pages/auth/register/register.component.html and review the template input tags:
formControlName="name" formControlName="email" formControlName="password"
It is almost the same notation we used on template-driven forms, but a little more clean. Here, we don't need the name attribute.
For the submit button event, we are just using the [formGroup]="registerForm" (ngSubmit)="onSubmit()" attribute and the bind function.
import { Component, OnInit ...Read now
Unlock full access