GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Tutorials
  • Playground
  • Reference
  • code
  • FieldTree
  • FormValueControl
  • FormCheckboxControl
  • ControlValueAccessor
  • How the FormField directive works
  • InputSignal
  • Field
  • Signal
  • FieldState

This view

  • Original page
  • New address

GeezerVison is showing next.angular.dev — FormField • Angular

API

    
      class FormField<T> {}
    
    

The field to bind to the underlying form control.

FieldState for the currently bound field.

The node injector for the DOM element hosting this field binding.

The DOM element hosting this field binding.

Errors associated with this form field.

Focuses this field binding.

By default, this will focus the host DOM element. However, custom FormUiControls can implement custom focusing behavior.

@paramoptionsFocusOptions | undefined
@returnsvoid

Resets the bound control.

@returnsvoid

Registers this FormField as a binding on its associated FieldState.

This method should be called at most once for a given FormField. A FormField placed on a custom control (FormUiControl) automatically registers that custom control as a binding.

@parambindingOptionsFormFieldBindingOptions | undefined
@returnsvoid

Description

Binds a form FieldTree to a UI control that edits it. A UI control can be one of several things:

  1. A native HTML input or textarea
  2. A signal forms custom control that implements FormValueControl or FormCheckboxControl
  3. A component that provides a ControlValueAccessor. This should only be used for backwards compatibility with reactive forms. Prefer options (1) and (2).

This directive has several responsibilities:

  1. Two-way binds the field state's value with the UI control's value
  2. Binds additional forms related state on the field state to the UI control (disabled, required, etc.)
  3. Relays relevant events on the control to the field state (e.g. marks touched on blur)
  4. Provides a fake NgControl that implements a subset of the features available on the reactive forms NgControl. This is provided to improve interoperability with controls designed to work with reactive forms. It should not be used by controls written for signal forms.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.