October 2017
Intermediate to advanced
280 pages
6h 50m
English
Another data property defined in the Developer class is email. Let's add an input field for it. Above the Add button in the preceding form, add the following markup:
<div class="form-group">
<label class="control-label" for="emailInput">Email</label>
<div>
<input type="text" id="emailInput" class="form-control" name="emailInput"
[(ngModel)]="developer.email">
</div>
</div>
We can think of the [(ngModel)] attribute as an alternative to the ng-model directive from AngularJS. We will explain it in detail in the Two-way data binding with Angular section.
Although Angular provides a set of predefined validators, they are not enough for all the various formats our data can live in. Sometimes, we'll need custom validation ...
Read now
Unlock full access