File

src/app/user/forgot-password/forgot-password.component.ts

Metadata

selector app-forgot-password
styleUrls forgot-password.component.scss
templateUrl forgot-password.component.html

Constructor

constructor(auth: any, formBuilder: FormBuilder, router: Router)

Methods

onSubmit
onSubmit()
Returns: void

Properties

error
error: any
FormGroup
FormGroup: any
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)
  }
}

results matching ""

    No results matching ""