Min and Max validation in ngmodel

I have html code snippet as following:

<mat-form-field>
        <mat-label>Interest</mat-label>
        <input matInput type="number" [(ngModel)]="percentage" required>
      </mat-form-field>

The input number should be between 1 to 100. How can I add mat-error to this validation?

64 thoughts on “Min and Max validation in ngmodel”