Skip to main content
cngx-src documentation

CngxFormFieldPresenter

Directivev0.1.0WCAG AA

projects/forms/field/form-field-presenter.ts

Import#

import { CngxFormFieldPresenter } from '@cngx/forms/field'

Description#

Core coordination directive for cngx-form-field.

Reads a Signal Forms Field<T> accessor and derives all ARIA IDs, visibility states, and constraint metadata as pure computed() signals. Applied as a hostDirective on CngxFormField - not used directly in templates.

Metadata#

Host#

Providers#

CNGX_FORM_FIELD_HOST
useExisting CngxFormFieldPresenter

Relationships

Index#

Inputs#

input()Required

The Signal Forms field accessor - a callable that returns FieldState. Accepts Field<T> from @angular/forms/signals directly.

default { alias: 'field' }

Methods#

markAsTouched#void

Forwards markAsTouched into the bound field's state. Atoms inject CNGX_FORM_FIELD_HOST and call this from their focus-out path without importing the concrete presenter class.

HostBindings#

BindingExpression
[class.cngx-field--error]showError()
[class.cngx-field--touched]touched()
[class.cngx-field--dirty]dirty()
[class.cngx-field--disabled]disabled()
[class.cngx-field--required]required()
[class.cngx-field--pending]pending()
[class.cngx-field--readonly]readonly()
[class.cngx-field--hidden]hidden()
[class.cngx-field--valid]valid()