xtreamsrl / ngx-validation-errors

Angular library to easily show input validation errors
MIT License
39 stars 11 forks source link

Custom Form Input Component #37

Open psenechal opened 2 years ago

psenechal commented 2 years ago

I can't seem to figure out if ngx-validation-errors will work with custom form input components that use ControlValueAccessor. Surrounding the tag with a tag doesn't work and the tag is empty without containing the error message. Surrounding or adding *ngxValidationErrors="form.get('name'); errors as errors" doesn't seem to do anything at all and errors is completely empty. I tried adding the ngxValidationErrorsField inside the custom form input component instead of on the tag, but that doesn't work because it can't find the AbstractControl to bind to. It may be that it simply won't work for custom form input components, but I thought I would open an issue in case I'm just not seeing the solution.