We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1efd69e commit ee4c08cCopy full SHA for ee4c08c
packages/angular/src/lib/components/country-selector/country-selector.component.ts
@@ -46,7 +46,14 @@ import { FormsModule } from "@angular/forms";
46
export class CountrySelectorComponent {
47
countries = countryData;
48
value = model<CountryCode>();
49
- selected = computed(() => countryData.find((c) => c.code === this.value()));
+
50
+ selected = computed(() => {
51
+ if (!this.value()) {
52
+ return countryData[0];
53
+ }
54
55
+ return countryData.find((c) => c.code === this.value()) as CountryData;
56
+ });
57
58
handleCountryChange(code: string) {
59
const country = this.countries.find((c) => c.code === code) as CountryData;
0 commit comments