Skip to main content

FormNodeBinding

Public view of a concrete [formNode] binding.

Import

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

When to use it

Use for an injected binding, directive query, or integration callback. It describes the rendered binding, including outputs and host access; it is not a form node.

Declaration

type FormNodeBinding<TNode extends AnyNode = AnyNode> = {
readonly formNodeValueChange: OutputRef<NodeValue<TNode>>;
readonly formNodeChange: OutputRef<NodeValue<TNode>>;
readonly formNodeControlValueChange: OutputRef<NodeValue<TNode>>;
readonly formNodeSubmit: OutputRef<FormNodeSubmitEvent<TNode>>;
readonly formNodeSubmitBlocked: OutputRef<FormNodeSubmitEvent<TNode>>;
readonly element: HTMLElement;
readonly injector: Injector;
readonly node: Signal<TNode>;
readonly errors: Signal<readonly ValidationErrorWithTargetNode<TNode>[]>;
focus(options?: FocusOptions): void;
flush(): void;
reset(): void;
};

Type parameters

ParameterConstraintDefault
TNodeAnyNodeAnyNode

Declared members

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

MemberMeaning
formNodeValueChangeControl-originated value after it is committed, respecting debounce and flush. Programmatic node writes do not emit. Synchronous state is current in the handler; asynchronous validation may still be pending.
formNodeChangeShort name for formNodeValueChange. Both names share the same committed-value output. Emits control-originated values after debounce; programmatic writes do not emit. Listen with (formNodeChange) alongside [formNode].
formNodeControlValueChangeLatest parsed value received from the selected control adapter, before waiting for debounce. This does not guarantee a physical user interaction: custom controls can emit from code.
formNodeSubmitNative submission attempt on a form() binding, after preparing values and interaction state, before the validation gate and declared action. Emits even without onSubmit or when blocked. Programmatic submit() does not emit. Async listeners are not awaited.
formNodeSubmitBlockedNative attempt rejected by submitWhen, including pending validation with 'valid'. Emits after formNodeSubmit, even without a declared onSubmit action. Concurrent attempts, group bindings, and programmatic submit() do not emit this output.
elementHost element carrying the [formNode] directive.
injectorInjector belonging to the binding's host element.
nodeReactive reference to the node currently bound to the host.
errorsErrors visible to this binding, excluding errors owned by another binding.
focusFocuses this binding using its native or custom-control focus behavior.
flushCommits pending control-originated values for the bound node.
resetResets interaction state and control-specific parsing state.