The ControlValueAccessor Interface
Connect a custom widget to Angular forms.
Why Custom Controls
Angular forms work with native inputs out of the box. To make your own component (a rating widget, color picker, toggle) usable with ngModel and formControlName, it must implement ControlValueAccessor.
The Bridge
ControlValueAccessor (CVA) is the bridge between Angular's form model and your component's view. It defines how the model writes values in and how user changes flow back out.
All lessons in this course
- The ControlValueAccessor Interface
- Writing and Registering Values
- Handling Disabled and Touched States
- Validation in Custom Controls