I have a select iterating over a collection looking like this:
ctrl.countriesList = {
'DK': {countryName: 'Denmark', preferredLanguage: 'DA'}
'US': {countryName: 'USA', preferredLanguage: 'EN'}
}
and iteration over the object:
ng-options="country as country.countryName for country in $ctrl.countriesList"
so my dropdown is now correctly displaying the countryName property in the dropdown for each country, but it is still sorting by the ISO code value (DK, US) which in my case will often be inconsistent with the countrynames, so the sorting of countryNames in the dropdown is not alphabetical
How can I make the dropdown sort by countryName alphabetically? Thanks in advance!