iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Angular Signal Forms field metadata lets schema rules attach reactive, per-field values that other parts of an application can read. Use metadata(path, key, logic) to contribute a value, choose a reducer if multiple rules must be combined, and read the result from the field state. Angular’s API reference marks metadata() stable since Angular v22.0.
What field metadata means in Angular Signal Forms
Field metadata is data associated with an individual Signal Forms field. Schema rules contribute it, and the value can react to field values and other signals read by the rule. Angular’s built-in constraint validators, including required() and min(), also use this metadata system internally.
This feature is specific to Signal Forms. It is separate from Angular compiler metadata and TypeScript decorator or reflection metadata, which serve different purposes.
How to add metadata with a schema rule
Create a metadata key once, then share that key between the schema rule that contributes a value and the code that reads it. A key is an identity, not just a type: calling createMetadataKey<T>() twice creates two distinct keys, even if both calls use the same type parameter.
#1 Best Overall
In a schema rule, use metadata(path, key, logic). The callback receives field context, including the field value as a signal, its FieldState, and methods for reading other fields. Signals read in the callback become reactive dependencies, so the contribution can update when those values change. See Angular’s field metadata guide and the metadata() API reference.
Choose how multiple contributions combine
A metadata key without a reducer uses override semantics by default. If several schema rules contribute the same key, an earlier contribution may be discarded. That is appropriate when one contribution should take precedence, but not when the application needs to preserve or combine values.
Rank #2
Add a reducer when multiple contributions need to be combined. Angular documents built-in reducers and the creation of custom reducers in its field metadata guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
| Need | Approach | Effect |
|---|---|---|
| One contribution should take precedence | Use the default override behavior | Earlier values can be discarded when multiple rules contribute. |
| Several contributions must be combined | Provide a reducer | The reducer determines how contributions produce the resulting value. |
Read metadata and handle optional registration
Use hasMetadata(key) when a field may not have a schema rule registering that key. It tells you whether the key is registered on the field. Calling metadata(key) returns undefined if no rule registered the key; if it is registered, the method returns a signal containing the reduced value.
Rank #3
When registration is optional, check it before reading the metadata. When the schema guarantees registration, you can read it directly or use optional chaining where appropriate. Registration and the value are separate concerns: depending on the reducer, the registered metadata’s inner value may itself be undefined.
When to use managed metadata
Ordinary metadata is for reactive values associated with a field. Use managed metadata for lifecycle-aware objects tied to a field, such as resources, effects, or service handles. The managed key’s creation function receives field state and a signal of contributions. Angular stores the returned object as-is; it does not wrap that object in computed(). Consult the field metadata guide for the managed-key API and its lifecycle behavior.
Rank #4
Field metadata is not compiler or decorator metadata
The word “metadata” appears in several Angular and TypeScript contexts, but those APIs are not interchangeable:
Free tools Windows power users keep installed
One-click scans. No signup required.
- Signal Forms field metadata: reactive values contributed by schema rules and read from a particular field.
- Angular compiler metadata: information used by Angular tooling and template compilation. Angular documents annotation emission and
.metadata.jsonoutput in its compiler options reference. - TypeScript decorator metadata: decorator-related type metadata options and reflection examples documented in the TypeScript decorators handbook.
If you want a reactive value attached to a Signal Forms field, use the Signal Forms field metadata API—not compiler output or TypeScript decorator/reflection metadata.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

