Updated to angular 11

Now compiling with strict mode in typescript
Need to error checking now
This commit is contained in:
2020-11-22 10:13:37 +05:30
parent cabd6f2ea1
commit 6567f560ab
187 changed files with 1709 additions and 1184 deletions

View File

@ -12,7 +12,7 @@ import { AuthService } from '../auth.service';
styleUrls: ['./login.component.css'],
})
export class LoginComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement: ElementRef;
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
form: FormGroup;
hide: boolean;
showOtp: boolean;
@ -29,10 +29,10 @@ export class LoginComponent implements OnInit, AfterViewInit {
) {
this.hide = true;
this.showOtp = false;
this.createForm();
}
this.clientId = '';
this.returnUrl = '';
createForm() {
// Create form
this.form = this.fb.group({
username: '',
password: '',
@ -46,7 +46,9 @@ export class LoginComponent implements OnInit, AfterViewInit {
ngAfterViewInit() {
setTimeout(() => {
this.nameElement.nativeElement.focus();
if (this.nameElement !== undefined) {
this.nameElement.nativeElement.focus();
}
}, 0);
}