1

I want to create custom component for input text but I don't know how can I bind validation of each input field to custom component. Is there any way to set errors of each field as array of objects like below

  [errors]="[
        { type: 'required', message: 'REQUIRED'},
        { type: 'minlength', message: 'MINLENGTH=3' }
      ]"

https://stackblitz.comhttps://stackblitz.com/edit/angular-13-custom-input-controlvalueaccessor-qzezsm?file=src%2Fapp%2Fcustom-input%2Fcustom-input.component.html,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fcustom-input%2Fcustom-input.component.ts

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Apr 14, 2023 at 6:39

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.