import { Component , OnInit } from '@angular/core' ; import { AccountService } from "../../services/account.service" ; import { Router } from "@angular/router" ; @ Component ( { selector : 'app-forgot-password-modal' , templateUrl : './forgot-password-modal.component.html' , styleUrls : [ './forgot-password-modal.component.scss' ] , providers : [ AccountService ] } ) export class ForgotPasswordModalComponent implements OnInit { public throwError = false ; public throwSuccess = false ; public email : string ; public showLoader = false ; constructor ( private accountService , private router ) { } ngOnInit ( ) { } resetPassword ( ) { console . log ( this . email ) ; this . showLoader = true ; this . accountService . resetPassword ( this . email ) . then ( ( result ) => { if ( result ) { this . throwSuccess = true ; } else { this . throwError = true ; } this . showLoader = false ; } ) ; } loginLink ( ) { this . router . navigate ( [ '/base/start/login' ] ) ; } }