Async Validators
Explain how async validators handle validation rules that require a server round-trip, like checking username uniqueness.
Some validation rules can't be checked synchronously with local data alone — the canonical example is checking whether a username or email is already taken, which requires an HTTP call to the server. An AsyncValidatorFn handles this: instead of returning ValidationErrors | null directly, it returns an Observable<ValidationErrors | null> or Promise<ValidationErrors | null>, and Angular marks the control's status as PENDING while waiting for that Observable/Promise to resolve.
A synchronous validator is like checking a rule against a printed reference card in your pocket — instant. An async validator is like having to call the head office to confirm something — you mark the form 'pending' while you're on hold, and you don't want a slow, outdated call finally connecting and overriding an answer you already got from a faster, more recent call.