• Overview
@angular/forms/signals

ValidationError

interface

Common interface for all validation errors.

API

    
      interface ValidationError {}
    
    

kind

string

Identifies the kind of error.

message

string | undefined

Human readable error message.

ValidationError.WithField

interface

Validation error with a field.

This is returned from field state, e.g., catField.errors() would be of a list of errors with field: catField bound to state.

    
      interface WithField extends ValidationError {}
    
    

ValidationError.WithOptionalField

interface

Validation error with optional field.

This is generally used in places where the result might have a field. e.g., as a result of a validateTree, or when handling form submission.

    
      interface WithOptionalField extends ValidationError {}
    
    

ValidationError.WithoutField

interface

Validation error with no field.

This is used to strongly enforce that fields are not allowed in validation result.

    
      interface WithoutField extends ValidationError {}
    
    

Description

Common interface for all validation errors.

This can be returned from validators.

It's also used by the creation functions to create an instance (e.g. requiredError, minError, etc.).

Jump to details