|
1 | 1 | ```html
|
2 |
| -<div fxFlex> |
3 |
| - <!--password input filed--> |
4 |
| - <mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent.color"> |
5 |
| - <mat-label>Password</mat-label> |
6 |
| - <mat-pass-toggle-visibility #toggle matSuffix></mat-pass-toggle-visibility> |
7 |
| - <input matInput #password |
8 |
| - [type]="toggle.type" |
9 |
| - required |
10 |
| - placeholder="Password"> |
11 |
| - <mat-hint align="end" aria-live="polite"> |
12 |
| - {{password.value.length}} / 25 |
13 |
| - </mat-hint> |
14 |
| - </mat-form-field> |
15 |
| - <!--@angular-material-extensions/password-strength's main component--> |
16 |
| - <mat-password-strength #passwordComponent |
17 |
| - (onStrengthChanged)="onStrengthChanged($event)" |
18 |
| - [password]="password.value"> |
19 |
| - </mat-password-strength> |
20 |
| - <!--Password's strength info--> |
21 |
| - <mat-password-strength-info |
22 |
| - *ngIf="showDetails" |
23 |
| - [passwordComponent]="passwordComponent"> |
24 |
| - </mat-password-strength-info> |
25 |
| -</div> |
| 2 | +<!--password input filed--> |
| 3 | +<mat-form-field appearance="outline" style="width: 100%"> |
| 4 | + <mat-label>Password</mat-label> |
| 5 | + <mat-pass-toggle-visibility #toggle3 matSuffix></mat-pass-toggle-visibility> |
| 6 | + <input matInput #passwordWithConfirmation |
| 7 | + [type]="toggle3.type" |
| 8 | + [formControl]="passwordComponentWithConfirmation.passwordFormControl" |
| 9 | + placeholder="Password" |
| 10 | + required> |
| 11 | + |
| 12 | + <!--password hint--> |
| 13 | + <mat-hint align="end" aria-live="polite"> |
| 14 | + {{passwordWithConfirmation.value.length}} / {{passwordComponentWithConfirmation.max}} |
| 15 | + </mat-hint> |
| 16 | + |
| 17 | +<!-- Error Messages --> |
| 18 | + <mat-error *ngIf="passwordComponentWithConfirmation.passwordFormControl.hasError('required')"> |
| 19 | + Password is required |
| 20 | + </mat-error> |
| 21 | + <mat-error *ngIf="passwordComponentWithConfirmation.passwordFormControl.hasError('pattern')"> |
| 22 | + Password is not valid |
| 23 | + </mat-error> |
| 24 | +</mat-form-field> |
| 25 | + |
| 26 | +<!--@angular-material-extensions/password-strength's main component--> |
| 27 | +<mat-password-strength #passwordComponentWithConfirmation |
| 28 | + (onStrengthChanged)="onStrengthChanged($event)" |
| 29 | + [password]="passwordWithConfirmation.value"> |
| 30 | +</mat-password-strength> |
| 31 | + |
| 32 | +<!--Password's strength info--> |
| 33 | +<mat-password-strength-info |
| 34 | + *ngIf="showDetails3" |
| 35 | + [passwordComponent]="passwordComponentWithConfirmation"> |
| 36 | +</mat-password-strength-info> |
| 37 | + |
| 38 | +<!--password input field for confirmation--> |
| 39 | +<mat-form-field appearance="outline" class="mt-3" style="width: 100%"> |
| 40 | + <mat-label>Confirm Password</mat-label> |
| 41 | + <mat-pass-toggle-visibility #toggleConfirmPassword matSuffix></mat-pass-toggle-visibility> |
| 42 | + <input matInput #passwordToConfirm |
| 43 | + [type]="toggleConfirmPassword.type" |
| 44 | + [formControl]="passwordComponentWithConfirmation.passwordConfirmationFormControl" |
| 45 | + placeholder="Password"> |
| 46 | + |
| 47 | + <!-- password hint--> |
| 48 | + <mat-hint align="end" aria-live="polite"> |
| 49 | + {{passwordToConfirm.value.length}} / {{passwordComponentWithConfirmation.max}} |
| 50 | + </mat-hint> |
| 51 | + |
| 52 | + <!-- password error msgs--> |
| 53 | + <mat-error *ngIf="passwordComponentWithConfirmation.passwordConfirmationFormControl.hasError('required')"> |
| 54 | + Password confirmation is required |
| 55 | + </mat-error> |
| 56 | + <mat-error |
| 57 | + *ngIf="passwordComponentWithConfirmation.passwordConfirmationFormControl.hasError('notConfirmed')"> |
| 58 | + Password is not the same |
| 59 | + </mat-error> |
| 60 | +</mat-form-field> |
26 | 61 | ```
|
0 commit comments