diff options
Diffstat (limited to 'frontend/src/app/_modals/login-modal/login-modal.component.ts')
-rw-r--r-- | frontend/src/app/_modals/login-modal/login-modal.component.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/frontend/src/app/_modals/login-modal/login-modal.component.ts b/frontend/src/app/_modals/login-modal/login-modal.component.ts index c86c269a..e1535a25 100644 --- a/frontend/src/app/_modals/login-modal/login-modal.component.ts +++ b/frontend/src/app/_modals/login-modal/login-modal.component.ts @@ -4,6 +4,7 @@ import { CookieService } from 'ngx-cookie-service'; import { AuthService } from 'src/app/_services/auth.service'; import { UserInfoService } from 'src/app/_services/user-info.service'; import shared from '../../Shared'; +import {AfterViewInit, ElementRef} from '@angular/core'; @Component({ selector: 'app-login-modal', @@ -12,6 +13,8 @@ import shared from '../../Shared'; }) export class LoginModalComponent implements OnInit { + @ViewChild('closeButton') closeButton?: ElementRef; + username: string = ''; password: string = ''; @@ -38,7 +41,7 @@ export class LoginModalComponent implements OnInit { } else { this.authService.authenticate(response); - (<HTMLSelectElement>document.getElementById('closeButton')).click(); + (<HTMLSelectElement>this.closeButton?.nativeElement).click(); this.userInfoService.getUserInfo().subscribe((response) => { shared.photoId = response.photoId; }); |