July 2018
Intermediate to advanced
420 pages
8h 46m
English
A very good example to understand template-driven forms is the login form. Let's see login.component.html and login.component.ts:
[(ngModel)]="user.email" name="email" [(ngModel)]="user.password" name="password"
Note that we are using the two-way data binding syntax for ngModel = [(ngModel)]. This means that we can set the initial data from the login component class, but we can also update it.
Remember, Angular's ngModel can be used in three different ways:
Read now
Unlock full access