Created
January 6, 2015 15:27
-
-
Save jerryclinesmith/edb1be424da5123e4d94 to your computer and use it in GitHub Desktop.
angular-ui-select: Example using Single and Multiple choice with bootstrap theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vm.person = undefined; | |
vm.friends = undefined; | |
vm.people = [ | |
{ name: 'Jerry', id: 1 }, | |
{ name: 'Andy', id: 2 }, | |
{ name: 'Tom', id: 3 }, | |
{ name: 'Brian', id: 4 } | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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