Angular mat-error does not pop up, hided (picture included)

mat-error should be inside a mat-form-field after the matInput:

<mat-form-field>
  <input matInput name="email" ngModel type="email" placeholder="E-mail" class="form-control" #emailInput="ngModel" maxlength="25" required email/>
  <mat-error *ngIf="emailInput.invalid">Error</mat-error>
</mat-form-field>

https://material.angular.io/components/form-field/overview

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top