Skip to content

Instantly share code, notes, and snippets.

@eupharis
Last active December 20, 2015 20:28
Show Gist options
  • Save eupharis/6190205 to your computer and use it in GitHub Desktop.
Save eupharis/6190205 to your computer and use it in GitHub Desktop.
# where user_roles is an array filled with strings
# option's value and text will both be role
<select ng-model="selectedUser.role" ng-options="role for role in user_roles">
</select>
# where supported_languages is an array filled with objects
# option's value will be language.code and option's text will be language.label
<select ng-model="selectedUser.language_code"
ng-options="language.code as language.label for language in supported_languages">
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment