angular-material-extensions / select-country

Angular Material component that allow users to select a country or nationality with an autocomplete feature
https://angular-material-extensions.github.io/select-country/
MIT License
126 stars 40 forks source link

Possibility to use mat-error with mat-country-select #87

Open bastianferch opened 2 years ago

bastianferch commented 2 years ago

Is your feature request related to a problem? Please describe. I am currently trying to do a Reactive Form with requirements for country. I have not found a solution to put a mat-error to show up like in every other mat-form-field.

Describe the solution you'd like It would be nice if you can use mat-error on missing input, like you can use it in every other mat-form-field. Something like this For Example:

<mat-select-country appearance="standard" label="Country" placeHolder="Country" formControlName="country" 
                 [nullable]="true" required >
                 <mat-error *ngIf="country.errors">
                  Please enter a valid country
                 </mat-error>
</mat-select-country> 

Describe alternatives you've considered I have tried to implement it using native forms, but I have found no way to look it like angular material. Some toast messages solves the problem, but does not look very good.