Binds a form FieldTree to a UI control that edits it. A UI control can be one of several things:
- A native HTML input or textarea
- A signal forms custom control that implements
FormValueControlorFormCheckboxControl - A component that provides a
ControlValueAccessor. This should only be used for backwards compatibility with reactive forms. Prefer options (1) and (2).
field
InputSignal<FieldTree<T>>state
Signal<FieldState<T, string | number>>Description
Binds a form FieldTree to a UI control that edits it. A UI control can be one of several things:
- A native HTML input or textarea
- A signal forms custom control that implements
FormValueControlorFormCheckboxControl - 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:
- Two-way binds the field's value with the UI control's value
- Binds additional forms related state on the field to the UI control (disabled, required, etc.)
- Relays relevant events on the control to the field (e.g. marks field touched on blur)
- Provides a fake
NgControlthat implements a subset of the features available on the reactive formsNgControl. 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.
Jump to details