Last active
December 28, 2021 22:47
-
-
Save NyaGarcia/0c283a7589115134d2048b3d35187167 to your computer and use it in GitHub Desktop.
Login Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="form" [formGroup]="form" (ngSubmit)="onSubmit()"> | |
<mat-form-field class="form-control"> | |
<mat-label>Email</mat-label> | |
<input matInput formControlName="email" type="text" required /> | |
<mat-error *ngIf="email?.hasError('required')"> | |
Email is required | |
</mat-error> | |
<mat-error *ngIf="email?.hasError('email')"> | |
Email isn't valid. Please enter a valid email. | |
</mat-error> | |
</mat-form-field> | |
<mat-form-field class="form-control"> | |
<mat-label>Password</mat-label> | |
<input matInput formControlName="password" type="password" required /> | |
<mat-error *ngIf="password?.hasError('required')"> | |
Password is required | |
</mat-error> | |
</mat-form-field> | |
<div class="form-footer"> | |
<button [disabled]="form.invalid" mat-raised-button type="submit"> | |
Submit | |
</button> | |
</div> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment