rsertelon / iso-3166-country-codes-angular

Javascript lib for ISO 3166 Country codes
http://rsertelon.github.io/iso-3166-country-codes-angular
The Unlicense
34 stars 31 forks source link

getCountryCode returns undefined #23

Closed aalega2 closed 6 years ago

aalega2 commented 8 years ago

Hi,

I like the plugin, however everything works except for getCountryCode. Any ideas?

rsertelon commented 8 years ago

Hi,

I'll try to look into it this week, no promise ;)

TBxy commented 8 years ago

toUpperCase() is missing (holder.codeToCountry[key])

for(var key in holder.codeToCountry) {
  holder.countryToCode[holder.codeToCountry[key].toUpperCase()] = key;
  holder.countryCodes.push(key);
}