From f4d7b7c41ccaab06e50351cf144157d5194c0545 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 28 Mar 2021 18:18:00 +0300 Subject: Implemented a password show and hide button to register and login pages; added it's icons (eye and eye-off) --- src/app/components/register/register.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/app/components/register/register.component.ts') diff --git a/src/app/components/register/register.component.ts b/src/app/components/register/register.component.ts index 07b8976..6d84e11 100644 --- a/src/app/components/register/register.component.ts +++ b/src/app/components/register/register.component.ts @@ -16,6 +16,7 @@ export class RegisterComponent implements OnInit { @ViewChild(ErrorBarComponent) private _errorBar: ErrorBarComponent; private _title = 'Register'; public registerUserFormGroup: FormGroup; + public showingPassword = false; constructor(private _titleService: Title, private _fb: FormBuilder, private _router: Router, private _userService: UserService, private _tokenService: TokenService) { this._titleService.setTitle(this._title); @@ -49,6 +50,10 @@ export class RegisterComponent implements OnInit { // this.registerUserFormGroup.valueChanges.subscribe(console.log); } + toggleShowPassword(): void { + this.showingPassword = !this.showingPassword; + } + onSubmit(): void { this._userService.registerUserRequest(this.registerUserFormGroup).subscribe({ next: (res: object) => { @@ -60,6 +65,7 @@ export class RegisterComponent implements OnInit { } }); } + onRedirectLogin(): void { this._router.navigate(['/login']); } -- cgit v1.2.3