#132

In this lecture you will learn what is an async validator and how to create & use it on a reactive form. Creating an async validator is very similar to creating a sync validator. The only difference is that, async validator either returns a promise or an observable. Also remember that, angular does not provide any built in async validator. But it allows us to create an async validator.
We use the async validator when we need to send an HTTP call to the server to check if the data is valid. Creating a Async Validator is simple as creating a function, which must obey the following rules:
1. The function must return either an observable or a promise
2. Return null for valid, or an ValidationErrorCode if the input is invalid
Let's understand async validator with a simple example, in this lecture.
YOU CAN DOWNLOAD THE STARTUP PROJECT FROM HERE: github.com/manojjha86/angular...
YOU CAN DOWNLOAD THE FINAL PROJECT FROM HERE: github.com/manojjha86/angular...

Пікірлер: 4

  • @ishmaelchirume9480
    @ishmaelchirume94806 ай бұрын

    I hope after completing your course I'll be of the best angular developer

  • @ishmaelchirume9480
    @ishmaelchirume94806 ай бұрын

    Thank you procademy

  • @nithinreddy9548
    @nithinreddy95483 ай бұрын

    HI Manoj, Is it not mandatory to wrap the multiple validators(Async Validator) inside of an array? Because for first name and last name you mentioned that if we are using multiple validators we need to make the form control to an array?

  • @lalanggumirang
    @lalanggumirang6 ай бұрын

    i am looking for clean architecture angular, maybe next time you like to teach it on your channel