When creating a custom form control in Angular, which interface should it implement to work seamlessly with Angular's form directives?

  • ControlValueAccessor
  • FormControl
  • FormGroup
  • FormControlDirective
When creating a custom form control in Angular, it should implement the ControlValueAccessor interface to work seamlessly with Angular's form directives. This interface provides methods for connecting custom form controls with Angular's forms API, enabling the control to interact correctly with form directives like ngModel, formControl, and formGroup. The other options (FormControl, FormGroup, FormControlDirective) are related to form handling but do not specifically enable custom form control integration.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *