Skip to content

Instantly share code, notes, and snippets.

@klement97
Last active March 26, 2020 19:06
Show Gist options
  • Save klement97/617bd6acfaa05edeaf6bc6afb853418b to your computer and use it in GitHub Desktop.
Save klement97/617bd6acfaa05edeaf6bc6afb853418b to your computer and use it in GitHub Desktop.
<!-- first name -->
<mat-form-field appearance="outline">
<mat-label> First Name</mat-label>
<input matInput type="text" formControlName="first_name">
<mat-error *ngIf="signUpForm.get('first_name').errors.required">
This field is required
</mat-error>
<mat-error *ngIf="signUpForm.get('first_name').errors.minlength">
Min length is {{signUpForm.get('first_name').errors.minlength.requiredLength}}
</mat-error>
<mat-error *ngIf="signUpForm.get('first_name').errors.maxlength">
Max length is {{signUpForm.get('first_name').errors.maxlength.requiredLength}}
</mat-error>
</mat-form-field>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment