Skip to main content
cngx-src documentation

CngxFormFieldControl

Interface

projects/core/tokens/form-field-control.token.ts

Referenced by#

Import#

import { CngxFormFieldControl } from '@cngx/core/tokens'

Description#

Contract every form control fulfils when participating in a cngx-form-field (or any future host that adopts the same shape).

Implementations expose five reactive surfaces the host reads on every change-detection cycle plus an optional imperative focus method. The contract is value-shape-agnostic - both scalar (boolean / string / undefined) and array-shaped controls satisfy it because every field is a Signal<...> (no value-type leakage into the contract).

Layer note. Lives in @cngx/core/tokens (Level 1) so Level-2 atoms in @cngx/common/* can provide the token without importing from the Level-3 @cngx/forms/field library - Sheriff-clean by construction. @cngx/forms/field re-exports both this interface and the matching token for back-compatibility with the public-API surface forms consumers already depend on.

Index#

Instance Properties#

disabled#Signal
Readonly

Whether the control is disabled.

empty#Signal
Readonly

Whether the control's value is empty.

errorState#Signal
Readonly

Whether the control is in an error state.

focused#Signal
Readonly

Whether the control currently has DOM focus.

id#Signal
Readonly

Unique element ID for the control.

Methods#

focus#void
Optional
focus(options?: FocusOptions)

Programmatically focus the control.

@paramoptions?FocusOptions