85. Create a Custom Asynchronous Validator in the Reactive Forms - Angular

Поділитися
Вставка
  • Опубліковано 2 жов 2024
  • Hi Friends
    In this video, we will see how to create a custom asynchronous validator in the reactive forms in the angular
    If you like my video, please subscribe to my channel.
    UA-cam Page: / leelawebdev
    Facebook Page: / leelawebdev
    Twitter Page: / leelanarsimha
    Linkedin: / leela-narasimha-reddy-...
    GitHub: github.com/lee...
    #Angular #leelawebdev

КОМЕНТАРІ • 8

  • @quanngang653
    @quanngang653 11 місяців тому

    Can I call the API and check if Email exists this way?

  • @mugatu2017
    @mugatu2017 2 роки тому +1

    i need to use isARestrictedEmail(form: AbstractControl): Promise | Observable to avoid error messages in the template

  • @rishikumar_s
    @rishikumar_s 2 роки тому

    Hi Leela, I dont want to hit the server each time i enter the value in email text-box. I wanted to check the email validation only after i came out of that text-box. How can we achieve this ? Could you please explain

    • @rishikumar_s
      @rishikumar_s 2 роки тому +2

      got it ... email:new FormControl(null,{validators:[Validators.required],asyncValidators:[this.isRestrictedEmail],updateOn:'blur'})

  • @cesarjunio6511
    @cesarjunio6511 3 роки тому

    good day sir there's an error in "this.isRestrictedEmails" at the formgroup it says Argument of type '(control: FormControl) => Promise | Observable' is not assignable to parameter of type 'AsyncValidatorFn | AsyncValidatorFn[] | null | undefined'.
    Type '(control: FormControl) => Promise | Observable' i use angular 12 thank you

    • @LeelaWebDev
      @LeelaWebDev  3 роки тому

      I need to check

    • @rutvikjr8251
      @rutvikjr8251 3 роки тому

      same problem. have you solved it?

    • @DeerajReddy
      @DeerajReddy 3 роки тому

      change the control Argument type in isRestrictedEmail function from FormControl to AbstractControl. worked..
      @Leela can you pls explain the difference between FormControl and AbstractControl?