Chore: Moved from Untyped to Stongly Typed forms.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
@ -13,7 +13,7 @@ import { AuthService } from '../auth.service';
|
||||
})
|
||||
export class LoginComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: UntypedFormGroup;
|
||||
form: FormGroup;
|
||||
hide: boolean;
|
||||
showOtp: boolean;
|
||||
clientId = '';
|
||||
@ -25,14 +25,13 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
||||
private router: Router,
|
||||
private toaster: ToasterService,
|
||||
private cs: CookieService,
|
||||
private fb: UntypedFormBuilder,
|
||||
) {
|
||||
this.hide = true;
|
||||
this.showOtp = false;
|
||||
this.form = this.fb.group({
|
||||
username: '',
|
||||
password: '',
|
||||
otp: '',
|
||||
this.form = new FormGroup({
|
||||
username: new FormControl('', { validators: Validators.required, nonNullable: true }),
|
||||
password: new FormControl('', { validators: Validators.required, nonNullable: true }),
|
||||
otp: new FormControl(0),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user