I have a list of countries (with codes and names) and when the list is unfolded I want to display "code + name" (for example "+44 United Kingdom") but when we select one country, only display the code ("+44"). Is possible to do with Angular ngOptions?
<select ng-model="userData.phoneCode" ng-options="(c.countryCallingCode.replace('00', '+') + ' ' + c.countryName) for c in countries track by c.countryId">
<option value="" disabled selected data-i18n="Country"></option>
</select>
Format of country list in the controller:
countries = [
{
"countryCallingCode":"0033",
"countryCode":"FR",
"countryId":123,
"countryName":"France"
},
]
I want this:
I have been searching in google and I tried to create a Directive for this (my level in angularjs is medium) but I don't find a solution, always display the selected option as "code + name".
Any idea?


