October 2017
Intermediate to advanced
280 pages
6h 50m
English
As the next step, let's create the template for the AddDeveloper component (step-1/add_developer.html). Add the following content to the file:
<span *ngIf="errorMessage"
class="alert alert-danger">{{errorMessage}}</span>
<span *ngIf="successMessage"
class="alert alert-success">{{successMessage}}</span>
These two elements are intended to display the error and success messages when we add a new developer. They will be visible when errorMessage or successMessage have nonfalsy values (that is, something different from the empty string, false, undefined, 0, NaN, or null).
Now, let's develop the actual form:
<form #f="ngForm" class="form col-md-4" [hidden]="submitted" (ngSubmit)="addDeveloper()"> ...
Read now
Unlock full access