Skip to content

Commit

Permalink
Display password mismatch error
Browse files Browse the repository at this point in the history
  • Loading branch information
marvac committed Jan 28, 2019
1 parent 5e79b8a commit edb9c93
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Client/src/app/components/register/register.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@ <h2 class="text-center text-primary">Sign Up</h2>
</div>

<div class="form-group">
<input type="password" formControlName="confirmPassword" class="form-control" placeholder="Confirm Password">
<input [ngClass]="{'is-invalid':(registerForm.get('confirmPassword').errors &&
registerForm.get('confirmPassword').touched) ||
(registerForm.hasError('mismatch') &&
registerForm.get('confirmPassword').touched)}"
type="password"
formControlName="confirmPassword"
class="form-control"
placeholder="Confirm Password">

<div *ngIf="registerForm.get('confirmPassword').hasError('required') && registerForm.get('confirmPassword').touched" class="invalid-feedback">Password is required</div>
<div *ngIf="registerForm.hasError('mismatch') && registerForm.get('confirmPassword').touched" class="invalid-feedback">Passwords must match</div>
</div>

<div class="form-group text-center">
Expand Down

0 comments on commit edb9c93

Please sign in to comment.