Skip to content

Instantly share code, notes, and snippets.

@jerryclinesmith
Created January 6, 2015 15:27
Show Gist options
  • Save jerryclinesmith/edb1be424da5123e4d94 to your computer and use it in GitHub Desktop.
Save jerryclinesmith/edb1be424da5123e4d94 to your computer and use it in GitHub Desktop.
angular-ui-select: Example using Single and Multiple choice with bootstrap theme
vm.person = undefined;
vm.friends = undefined;
vm.people = [
{ name: 'Jerry', id: 1 },
{ name: 'Andy', id: 2 },
{ name: 'Tom', id: 3 },
{ name: 'Brian', id: 4 }
];
%h1 People
%h2 Multiple choice
%ui-select(multiple=true ng-model="vm.friends" theme="bootstrap")
%ui-select-match(placeholder="Select friend(s)")
{{$item.name}}
%ui-select-choices(repeat="person in vm.people")
%div(ng-bind-html="person.name")
%br
%pre
{{ vm.friends | json }}
%h2 Single choice
%ui-select(ng-model="vm.person" theme="bootstrap")
%ui-select-match(placeholder="Select a person")
{{$select.selected.name}}
%ui-select-choices(repeat="person as person in vm.people | filter: $select.search")
%div(ng-bind-html="person.name | highlight: $select.search")
%br
%pre
{{ vm.person | json }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment