Closed Mark-Durkot closed 5 months ago
After playing around, I found out that it works fine using a FormGroup and accessing the value through formControlName:
form = new FormGroup({
country: new FormControl<Country>({ alpha2Code: 'UK' })
});
<form [formGroup]="form">
<mat-select-country
formControlName="country"
[language]="'uk'"
></mat-select-country>
</form>
For me this issue still persists. If language is set, the country cannot be initially set.
Hello guys, great component, enjoy using it. But I encountered an issue. When I define the component with [language] and [formControl]/[value] inputs, the language sets correctly but the default value fails.
<mat-select-country [formControl]="formControl" [language]="'uk'"></mat-select-country>
After executing formControl.patchValue({ alpha2Code: 'UK' }) the flag of that country renders, but the name still fails to set. I also encountered this with [value]='defaultValue' (where defaultValue is type Country).
<mat-select-country [value]="defaultValue" [language]="'uk'"></mat-select-country>
defaultValue: Country = { alpha2Code: 'UK' }