Skip to content

Commit e94bfc8

Browse files
Merge remote-tracking branch 'origin/master'
2 parents 8f826cc + 4ce0f15 commit e94bfc8

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/app/modules/auth/pages/sign-up-page/sign-up-page.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@
3939
>
4040
<mat-icon>{{ hide ? 'visibility_off' : 'visibility' }}</mat-icon>
4141
</button>
42-
<mat-hint
43-
>Must be minimum eight characters, at least one uppercase letter, one lowercase letter
42+
<mat-hint [class.text-red]="passwordControls.invalid && passwordControls.touched"
43+
>Must be minimum eight characters, at least one uppercase letter, one lowercase letter
4444
and one number</mat-hint
4545
>
46-
<mat-error *ngIf="password.invalid">{{ getErrorMessage('password') }}</mat-error>
4746
</mat-form-field>
4847
</p>
4948
<p>

src/app/modules/auth/pages/sign-up-page/sign-up-page.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,7 @@
5555
padding: 1rem;
5656
}
5757
}
58+
59+
.text-red {
60+
color: $red;
61+
}

src/app/modules/auth/pages/sign-up-page/sign-up-page.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component } from '@angular/core';
22
import { transition, trigger, useAnimation } from '@angular/animations';
33
import { fadeIn } from 'ng-animate';
4-
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
4+
import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
55
import { AuthService } from '../../auth.service';
66
import { UtilsService } from '~modules/core/services/utils.service';
77
import { RoutesConfig } from '~app/configs/routes.config';
@@ -32,6 +32,7 @@ export class SignUpPageComponent {
3232
Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,}$'),
3333
]);
3434
hide = true;
35+
passwordControls: AbstractControl;
3536

3637
constructor(
3738
private formBuilder: FormBuilder,
@@ -45,6 +46,8 @@ export class SignUpPageComponent {
4546
email: this.email,
4647
password: this.password,
4748
});
49+
50+
this.passwordControls = this.signUpForm.controls['password'];
4851
}
4952

5053
getErrorMessage(field: any): string | void {

0 commit comments

Comments
 (0)