• Overview
@angular/forms/signals

customError

function

API

function customError<E extends Omit<Partial<ValidationError>, typeof BRAND>>(
  obj: WithField<E>,
): CustomValidationError;
function customError<E extends Omit<Partial<ValidationError>, typeof BRAND>>(
  obj?: E | undefined,
): WithoutField<CustomValidationError>;
function customError<E>(obj: WithField<E>): CustomValidationError;

Create a custom error associated with the target field

@paramobjWithField<E>

The object to create an error from

function customError<E>(obj?: E | undefined): WithoutField<CustomValidationError>;

Create a custom error

@paramobjE | undefined

The object to create an error from

Jump to details