To display error message in Angular 2 from backend, we have to set the error message equal to an angular variable, and then check whether that variable exists to conform whether to display it or not.

<div *ngIf="errors" class="alert alert-danger">
    {{ errors }}
</div>

 

BY Best Interview Question ON 22 Jul 2019