November 2019
Beginner
436 pages
8h 52m
English
Given that the authentication may fail, let's provide some minimalistic error handling:
<h1>Login</h1> <h2 class="error" *ngIf="error">Error: {{ error }}</h2>
As you can see, we only display the h2 element if the error property value is provided for us.
.error { color: red; }
// ... export class LoginComponent implements OnInit { error = ''; // ... }
In the next section, we are going to address the result ...
Read now
Unlock full access