I have a directive that already implements the ControlValueAccessor
interface (directive's selector is input[type=date]
) and now I need another directive that also implements ControlValueAccessor
with the selector input[type=date][datepicker]
- let's name it the datepicker directive.
Both directives have selectors that overlap, causing an error when using the datepicker directive:
ERROR Error: Uncaught (in promise): Error: More than one custom value accessor matches form control with unspecified name attribute
The error can be traced back to this location: https://github.com/angular/angular/blob/5.2.x/packages/forms/src/directives/shared.ts#L206
I am thinking of a way to instruct Angular to provide the datepicker directive whenever possible, but I'm not sure how to achieve that. Any ideas?