Skip to main content

FormNodeStateOptions

Reactive error contribution configured by a custom-control component.

Import

import type { FormNodeStateOptions } from '@ngblocks/form-nodes';

When to use it

Configure a reactive component-owned error source for useFormNodeState(). Return an error, a message, a readonly array, or no result.

Declaration

type FormNodeStateOptions = {
errors?: () => ControlError | string | null | undefined | void | readonly (ControlError | string)[];
};

Declared members

The declaration above also includes inherited contracts and overloads where applicable.

MemberMeaning
errorsContributes component-owned errors to the current binding. Strings become kind 'custom'. null, undefined, void, and [] mean no errors. Reads track signal dependencies, even if the bound value stays unchanged. Read local control state, never the resulting state.errors(). Returning no errors removes only this contribution; destruction and rebinding clean it up. CVAs using Angular 22 Signal Forms also need provideFormNodeStateErrors().