Guest User

Untitled

a guest
Dec 11th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. // signIn.component.html
  2.  
  3. <app-modal #signInModal>
  4. <div>
  5. <form class="login-form" [formGroup]="loginForm">
  6. <mat-form-field class="example-full-width">
  7. <input matInput placeholder="Username or Email"
  8. formControlName="username" class="text-lowercase"
  9. [ngClass]="{'hasError': loginForm.controls.username.dirty && loginForm.controls.username.errors}">
  10. </mat-form-field>
  11. <div class="formPropertiesValidations">
  12. <div *ngIf="loginForm.controls.username.dirty">
  13. <div class=" text-danger error"
  14. maxlength="20"
  15. *ngIf="loginForm.get('username').hasError('required')">
  16. Username is required
  17. </div>
  18. </div>
  19. </div>
  20. <mat-form-field>
  21. <input matInput placeholder="Password" formControlName="password"
  22. [type]="password"
  23. [ngClass]="{'hasError': loginForm.controls.password.dirty && loginForm.controls.password.errors}">
  24. </mat-form-field>
  25. <div class="formPropertiesValidations">
  26. <div *ngIf="loginForm.controls.password.dirty">
  27. <div class=" text-danger error"
  28. *ngIf="loginForm.get('password').hasError('required')">
  29. Password is required
  30. </div>
  31. </div>
  32. </div>
  33.  
  34. <button mat-raised-button color="primary" [disabled]="!loginForm.valid"
  35. (click)="login(loginForm.value)">Login
  36. </button>
  37. </form>
  38. </div>
  39. </app-modal>
Add Comment
Please, Sign In to add comment