I need a reusable mat-chip-list
input, which knows the following: can type anything in the input, but only valid email addresses can be added to the chip list. If the input has an invalid email in it and user presses ENTER
, COMMA
or TAB
, then the input value cannot be added to the list and the mat-form-field
should have an error.
I have a working example, but that's not reusable as mat-form-field
's input and I need to copy-paste it every time I want to use it :(
I am open to any ideas how to solve the problem, I tried to invoke an error in the mat-form-field
from the custom input (which is not nice, I know) and I tried to create a special validator for the mat-form-field
, but it also failed.
I'm using Angular 9.1.12 & Angular Material 9.2.4.
Here is an example for a the new reusable, but not working component and the not reusable but working component: https://stackblitz.com/edit/angular-material-chip-list-email-input