Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default country #11

Closed
cho-wtag opened this issue May 6, 2020 · 13 comments
Closed

Set default country #11

cho-wtag opened this issue May 6, 2020 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@cho-wtag
Copy link

cho-wtag commented May 6, 2020

I want to view an already selected country (using alpha2Code) from API call. Is there any solution available for now? If not is there any other way to do it?

@AnthonyNahas AnthonyNahas self-assigned this May 18, 2020
@AnthonyNahas AnthonyNahas added enhancement New feature or request good first issue Good for newcomers PR Welcome labels May 18, 2020
@gchokeen
Copy link

gchokeen commented Sep 3, 2020

I have same issue, I want to pre-select the country, I gave value to country input, It just showing the flag but not country name.

<mat-select-country appearance="outline" [country]="India"
                    (onCountrySelected)="onCountrySelected($event)">
                  </mat-select-country>

image

Any idea? how to solve it!

@christophe-mailfert
Copy link

Same problem :)

@AnthonyNahas AnthonyNahas added the bug Something isn't working label Oct 4, 2020
@AnthonyNahas
Copy link
Member

which version are you using ?

@AnthonyNahas AnthonyNahas added ready and removed PR Welcome bug Something isn't working good first issue Good for newcomers labels Oct 4, 2020
@Beebeeoii
Copy link

Beebeeoii commented Oct 14, 2020

Currently on the latest version 2.2.0. Tried setting default country by [country]="country" in .html and country="Australia" in .ts, Also tried [value] instead but also does not work.

Issue:
Name of country not showing up. Flag shows up fine though.

please assist. thanks!

@sohinim98
Copy link

I have the same error where adding country = alpha2Code displays the country flag, but not the country name. Please fix this ASAP. Urgent.

@AnthonyNahas
Copy link
Member

Please when using the newest version 3.0.0 please use [value] instead of [country]

Finally, I've released a new major version of the library 3.0.0

With this release

Bildschirmfoto 2020-10-23 um 22 36 45

https://github.com/angular-material-extensions/select-country/releases/tag/3.0.0

If you love this library please share it with your team and friends and please make sure that your are not missing any
cool angular library or component within my angular material extensions

thank you all and cheers 🍻

@vickieallen
Copy link
Contributor

vickieallen commented Jan 12, 2021

I don't think this is resolved. I am using "@angular-material-extensions/select-country": "^3.0.4",

If I pass the full Country object to [value] then it works, but as above, I only have the alpha2 code returned from the API and no way of populating the other fields in Country as you do not expose the full list of countries to my knowledge for me to find the country in?

Please can there be a way to set the default value from just the alpha2 code. Currently it simply sets the flag, but leaves the text blank which is not ideal.

@AnthonyNahas AnthonyNahas reopened this Jan 14, 2021
@AnthonyNahas
Copy link
Member

@vickieallen I would appreciate a PR from you to improve that 🍻

@AnthonyNahas AnthonyNahas added bug Something isn't working and removed enhancement New feature or request ready labels Jan 14, 2021
@vickieallen
Copy link
Contributor

@AnthonyNahas as requested 👍 would be good to get this asap as need this fix for a client hoping to launch in the next week or so.

@AnthonyNahas
Copy link
Member

PR merged

release maybe tonight

thank you

@AnthonyNahas
Copy link
Member

@vickieallen 4.0.3 is now live

thank you all once again

@prayatna
Copy link

after using "@angular-material-extensions/select-country": "^4.0.3" I have started getting Cannot read property 'find' of undefined where the undefined is this.countries line 90 of mat-select-country.component.ts.

@Santisosa404
Copy link

Can be the version 4.0.3 used on Angular 11.2.14 or only 11.0.0? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants