Angular: From Zero to Expert

Angular: From Zero to Expert

Making Sense of Metadata in Angular Signal Forms

A practical guide using a real weather chatbot that validates cities against an API

Amos Isaila's avatar
Amos Isaila
Dec 15, 2025
∙ Paid

I’m going to walk you through metadata in Angular Signal Forms using a real project I built—a weather chatbot that checks if cities actually exist before letting you submit the form. No abstract examples, just working code solving actual problems.

Here’s what makes this interesting: the form doesn’t just validate that you typed something. It calls an API to verify the city exists in a weather database, manages the loading state while checking, caches results so you don’t hammer the server, and gives instant feedback. That’s where metadata becomes essential.

Angular Signal Forms: Metadata

The Core Problem

Traditional validation answers simple questions: Is the field empty? Does it match this pattern? But modern forms need smarter behavior. When someone types “Barcelona, Spain,” you want to know:

  • Does this city exist in your weather database?

  • Are we currently checking with the server?

  • Did we already validate this exact combination?

  • Should we show a spinner?

Your form data is just { city: “Barcelona”, country: “Spain” }. Everything else—the validation state, the API response, the loading indicators—that’s metadata. It’s the difference between what the user entered and what you need to know about what they entered.

Angular: From Zero to Expert is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

Starting With Basic Validation

Let’s look at the foundation. This is pure validation, no async behavior yet:

const cityNameSchema = schema<string>((path) => {
  required(path, { message: ‘City is required’ });
  minLength(path, 2, { message: ‘City must be at least 2 characters’ });
  maxLength(path, 50, { message: ‘City name is too long’ });
});

export const locationSchema = schema<WeatherLocation>((path) => {
  apply(path.city, cityNameSchema);
  apply(path.country, countryNameSchema);
});

This checks structure and format. But it doesn’t verify if Barcelona is real or if someone made it up. For that, you need to talk to an API.

Adding Real Validation

Here’s where it gets interesting. We’re going to validate cities against a weather API as the user types:

Keep reading with a 7-day free trial

Subscribe to Angular: From Zero to Expert to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Amos Isaila · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture