Reputation: 357
This is an ng-option select I'm using:
<select ng-model="languagePicker" ng-options="language for (key,value) in getLanguages()" ng-click="pickLanguage(0,languagePicker)"></select>
Passing languages2 in the chooseLanguage function makes it pass the value. I'd like to pass the key. How do I do it? Tried gooling it but no luck with how to do that in objects.
This is an example of what .getLanguages() returns:
{
"pl-PL":"Polish",
"en-GB":"English"
}
Upvotes: 0
Views: 107