Skip to content

Instantly share code, notes, and snippets.

@ldong
Last active January 17, 2017 18:44
Show Gist options
  • Save ldong/179f091a516ef979a2ecf3a0111ddbba to your computer and use it in GitHub Desktop.
Save ldong/179f091a516ef979a2ecf3a0111ddbba to your computer and use it in GitHub Desktop.
<select placeholder="Select">
  <option
    ng-repeat="u in users"
    ng-if="u.name != user.name"
    value="{{u}}">{{u.name}}</option>
</select>

<select
  placeholder="Select"
  ng-model="taggee"
  required="required"
  ng-options="u.name for u in users | filter: removeUserSelf">
</select>

Dropdowns made with ng-options allows the selected value to be an object, while dropdowns made from ng-repeat has to be a string.

Src: http://www.w3schools.com/angular/angular_select.asp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment