File
Metadata
selector |
app-forgot-password |
styleUrls |
forgot-password.component.scss |
templateUrl |
forgot-password.component.html |
Methods
onSubmit
|
onSubmit()
|
Returns: void
|
loading
|
loading: boolean
|
Default value: false
|
resetForm
|
resetForm: boolean
|
submitted
|
submitted: boolean
|
Default value: false
|
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { AuthService } from 'src/app/services/auth/auth.service';
@Component({
selector: 'app-forgot-password',
templateUrl: './forgot-password.component.html',
styleUrls: ['./forgot-password.component.scss']
})
export class ForgotPasswordComponent implements OnInit {
error: any
loading: boolean = false
submitted: boolean = false
resetForm!: FormGroup
constructor(
private auth: AuthService,
private formBuilder: FormBuilder,
private router: Router
) { }
ngOnInit(): void {
this.resetForm = this.formBuilder.group({
email: ['', Validators.required]
})
}
onSubmit(): void {
this.auth.forgotPassword(this.resetForm.controls['email'].value)
}
}