Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <mat-form-field hintLabel="Minimum 8 Characters" class="">
- <mat-label>Password</mat-label>
- <input
- matInput
- #input
- type="password"
- formControlName="password">
- <mat-hint align="end">{{input.value?.length || 0}}/8</mat-hint>
- </mat-form-field>
- <mat-form-field>
- <mat-label>Confirm</mat-label>
- <input
- matInput
- required
- type="password"
- #confirm
- formControlName="confirmPassword">
- <mat-error *ngIf="form.get('confirmPassword').invalid || confirmPasswordMismatch">Password does not match</mat-error>
- </mat-form-field>
- public get confirmPasswordMismatch() {
- return (this.form.get('password').dirty || this.form.get('confirmPassword').dirty) && this.form.hasError('confirmedDoesNotMatch');
- }
- this.form = new FormGroup({
- userName: new FormControl(null, [Validators.required]),
- fullName: new FormControl(null, [Validators.required]),
- email: new FormControl(null, [Validators.required, Validators.pattern(this.EMAIL_REGEX)]),
- password: new FormControl(null),
- confirmPassword: new FormControl(null, ),
- }, (form: FormGroup) => passwordValidator.validate(form));
Add Comment
Please, Sign In to add comment