UNPKG

ui-select

Version:
22 lines (18 loc) 1.28 kB
<button class="btn btn-default btn-xs" ng-click="ctrl.enable()">Enable ui-select</button> <button class="btn btn-default btn-xs" ng-click="ctrl.disable()">Disable ui-select</button> <button class="btn btn-default btn-xs" ng-click="ctrl.clear()">Clear ng-model</button> <h3>Select2 theme</h3> <h4>Single property binding with async data</h4> <p>Selected: <code> {{ctrl.personAsync.selected | json }}</code></p> <p>List Count: <code>{{ (ctrl.peopleAsync || []).length }}</code></p> <ui-select ng-model="ctrl.personAsync.selected" theme="select2" ng-disabled="ctrl.disabled" style="min-width: 300px;" title="Single property binding with async data"> <ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name || $select.selected}}</ui-select-match> <ui-select-choices repeat="person.email as person in ctrl.peopleAsync | propsFilter: {name: $select.search, age: $select.search}"> <div ng-bind-html="person.name | highlight: $select.search"></div> <small> email: {{person.email}} age: <span ng-bind-html="''+person.age | highlight: $select.search"></span> </small> </ui-select-choices> </ui-select> <p><small><em>Data will be populated in 3 secs</em></small></p>