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
Can I call the API and check if Email exists this way?
i need to use isARestrictedEmail(form: AbstractControl): Promise | Observable to avoid error messages in the template
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
got it ... email:new FormControl(null,{validators:[Validators.required],asyncValidators:[this.isRestrictedEmail],updateOn:'blur'})
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
I need to check
same problem. have you solved it?
change the control Argument type in isRestrictedEmail function from FormControl to AbstractControl. worked..
@Leela can you pls explain the difference between FormControl and AbstractControl?