Skip to main content
cngx-src documentation

CNGX_VALUE_TRANSFORMER

Tokenv0.1.0

InjectionToken<CngxValueTransformer<unknown>>

Description#

Resolves to the CngxValueTransformer a control publishes for translating between its typed value and its DOM display string:

  • format(raw) - on value-from-outside writes (field, setValue, value.set)
  • parse(display) - on user-input and blur reads

Provided on the control's own host by the directives that intercept its value channel: CngxInputMask, CngxInputFormat, CngxNumericInput. A host that needs the typed-to-display mapping resolves it here.

Optional and orthogonal to CNGX_FORM_FIELD_CONTROL: that token declares "I am the focusable element", this one "I translate its value channel" - one directive may provide both.

Type#

InjectionToken<CngxValueTransformer<unknown>>