
Learn how to implement asynchronous validation in Angular Signal Forms using validateHttp(). This guide shows how to validate user input with APIs for uniqueness checks, server-side rules, and other HTTP-based validation scenarios.
Alain Chautard
July 14, 2026
Asynchronous validation is used when checking constraints that require external resources such as:
Angular Signal Forms provide the validateHttp() function for standard API-based validation checks. It takes a request function that returns the URL to validate, and onSuccess and onError callbacks.
Here is a basic example:
validateHttp(path.address.zip, {
request: (ctx) => {
// Using valueOf to read the current value of another field
const country = ctx.valueOf(path.address.country);
// Getting current zip value
const zip = ctx.value();
// Returning API URL based on user values
return `https://api.zippopotam.us/${country}/${zip}`;
},
onSuccess: () => undefined,
onError: (err) => {
return { kind: 'invalidZip', message: 'Zip code is not valid' };
},
});
Every time the zip code is updated by the user, the HTTP request to the validation API is made. Requests are automatically canceled if the value changes before the server responds.
Note that onError is a callback that returns a process error (network issue, server unreachable, etc.), not a validation error. Validation errors have to be dealt with in the onSuccess callback, which means “Validation ran successfully”, not “Validation didn’t find any problem”.
If we want to wait a little bit before validating, we can use debouncing strategies, the simplest option being:
validateHttp(path.address.zip, {
request: (ctx) => {
const country = ctx.valueOf(path.address.country);
const zip = ctx.value();
return `https://api.zippopotam.us/${country}/${zip}`;
},
// Wait for 300ms after last value update before validating
debounce: 300,
onSuccess: () => undefined,
onError: (err) => {
return { kind: 'invalidZip', message: 'Zip code is not valid' };
},
});
This example will wait 300 milliseconds after the user stops typing before making the HTTP request to validate the zip code. If the user types another character before the 300 milliseconds have passed, the timer will be reset.
Note that this validator-level debounce option accepts a number of milliseconds or a custom DebounceTimer function (from @angular/core).
Note that asynchronous validation runs only after all synchronous validation rules have passed. This prevents unnecessary server requests: if a field fails a required or pattern check, no HTTP request is made.
When async validation runs, the field’s pending() signal returns true. During this time:
valid() returns falseinvalid() returns falseerrors() returns an empty arraysubmit() waits for validation to completeFor more information about Angular Signal Forms, check out my book on Amazon: Angular Signal Forms.
Get the latest news and updates on developer certifications. Content is updated regularly, so please make sure to bookmark this page or sign up to get the latest content directly in your inbox.

JavaScript Generators: Writing Iterators With yield
JavaScript generators explained: write lazy iterators with yield, handle infinite sequences, and skip the protocol boilerplate.
Martin Ferret
Jul 21, 2026

Designing Loading UI in React
A practical guide to loading UI in React: Suspense boundaries, skeletons vs spinners, avoiding layout shift, and animating reveals.
Aurora Scharff
Jul 16, 2026

Performance Optimization in Nuxt
Practical techniques for faster Nuxt apps
Reza Baar
Jul 15, 2026