Simpler angular material custom control implementing ControlValueAccessor and MatFormFieldControl interfaces

31 views Asked by At

I would like to extend the functionality of a material autocomplete component to use server data. I can already achieve this with no issue. I also wanted to make it reusable in multiple forms, for which I had to implement ControlValueAccessor and MatFormFieldControl interfaces.

But since my custom control is not a complex one as it is only adding some functionality to an existing autocomplete component, I think that I am overcomplicating my design here. This is basically an added layer on top of an MatInput, which already implements MatFormFieldControl interface.

Can I and how can I simply extend existing controls for simpler customization on existing control? As a beginner I am not able to find example of extending these controls. Can I direct all interface requirements to a child MatInput?

0

There are 0 answers