From 0d58551a6b54457fc24d926f46a6efd73e332901 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 14 Mar 2021 08:51:57 +0200 Subject: Removed unnecessary getters for form group controls from login and register components --- src/app/components/login/login.component.ts | 10 +--------- src/app/components/register/register.component.ts | 20 -------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts index f64848c..edbc461 100644 --- a/src/app/components/login/login.component.ts +++ b/src/app/components/login/login.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { FormGroup, FormBuilder, Validators, FormControl, AbstractControl } from '@angular/forms'; +import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms'; import { Router } from '@angular/router'; import { Title } from '@angular/platform-browser'; import { UserService } from 'src/app/services/user.service'; @@ -48,12 +48,4 @@ export class LoginComponent implements OnInit { onRedirectRegister(): void { this._router.navigate(['/register']); } - - get username(): AbstractControl | null { - return this.loginUserFormGroup.get('username'); - } - - get password(): AbstractControl | null { - return this.loginUserFormGroup.get('password'); - } } diff --git a/src/app/components/register/register.component.ts b/src/app/components/register/register.component.ts index e51a365..b5800ad 100644 --- a/src/app/components/register/register.component.ts +++ b/src/app/components/register/register.component.ts @@ -63,24 +63,4 @@ export class RegisterComponent implements OnInit { onRedirectLogin(): void { this._router.navigate(['/login']); } - - get firstName(): AbstractControl | null { - return this.registerUserFormGroup.get('firstName'); - } - - get lastName(): AbstractControl | null { - return this.registerUserFormGroup.get('lastName'); - } - - get username(): AbstractControl | null { - return this.registerUserFormGroup.get('username'); - } - - get email(): AbstractControl | null { - return this.registerUserFormGroup.get('email'); - } - - get password(): AbstractControl | null { - return this.registerUserFormGroup.get('password'); - } } -- cgit v1.2.3