diff options
Diffstat (limited to 'client/src/app/login/login.component.ts')
-rw-r--r-- | client/src/app/login/login.component.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index 9a68c12fa..8e8822510 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -2,12 +2,12 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | |||
2 | import { RedirectService, ServerService } from '@app/core' | 2 | import { RedirectService, ServerService } from '@app/core' |
3 | import { UserService } from '@app/shared' | 3 | import { UserService } from '@app/shared' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
5 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
6 | import { AuthService } from '../core' | 5 | import { AuthService } from '../core' |
7 | import { FormReactive } from '../shared' | 6 | import { FormReactive } from '../shared' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
9 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 8 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
10 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' | 9 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' |
10 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | ||
11 | 11 | ||
12 | @Component({ | 12 | @Component({ |
13 | selector: 'my-login', | 13 | selector: 'my-login', |
@@ -16,14 +16,17 @@ import { LoginValidatorsService } from '@app/shared/forms/form-validators/login- | |||
16 | }) | 16 | }) |
17 | 17 | ||
18 | export class LoginComponent extends FormReactive implements OnInit { | 18 | export class LoginComponent extends FormReactive implements OnInit { |
19 | @ViewChild('forgotPasswordModal') forgotPasswordModal: ModalDirective | 19 | @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef |
20 | @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef | 20 | @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef |
21 | 21 | ||
22 | error: string = null | 22 | error: string = null |
23 | forgotPasswordEmail = '' | 23 | forgotPasswordEmail = '' |
24 | 24 | ||
25 | private openedForgotPasswordModal: NgbModalRef | ||
26 | |||
25 | constructor ( | 27 | constructor ( |
26 | protected formValidatorService: FormValidatorService, | 28 | protected formValidatorService: FormValidatorService, |
29 | private modalService: NgbModal, | ||
27 | private loginValidatorsService: LoginValidatorsService, | 30 | private loginValidatorsService: LoginValidatorsService, |
28 | private authService: AuthService, | 31 | private authService: AuthService, |
29 | private userService: UserService, | 32 | private userService: UserService, |
@@ -84,10 +87,10 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
84 | } | 87 | } |
85 | 88 | ||
86 | openForgotPasswordModal () { | 89 | openForgotPasswordModal () { |
87 | this.forgotPasswordModal.show() | 90 | this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal) |
88 | } | 91 | } |
89 | 92 | ||
90 | hideForgotPasswordModal () { | 93 | hideForgotPasswordModal () { |
91 | this.forgotPasswordModal.hide() | 94 | this.openedForgotPasswordModal.close() |
92 | } | 95 | } |
93 | } | 96 | } |