为什么我的ui-select实现不起作用?我有plunkered我的问题。
<p>Selected: {{animator.selectedValue}}</p>
<ui-select ng-model="animator.selectedValue" theme="select2" ng-disabled="disabled" style="min-width: 300px;" title="Choose an animator">
<ui-select-match placeholder="Select an animator">{{$select.selected.value.lastName}}</ui-select-match>
<ui-select-choices repeat="animator.value as (key, animator) in animatorList">
<div ng-bind-html="animator.value.lastName"></div>
<small>{{animator.value.lastName}} {{animator.value.firstName}}</small>
</ui-select-choices>
</ui-select>
在js文件中:
$scope.animatorList = [
{ animatorId: 1, firstName: 'Adam', lastName: 'Dupont', email: 'adam@email.com', age: 12, country: 'United States' },
{ animatorId: 2, firstName: 'Amalie', lastName: 'Muller', email: 'amalie@email.com', age: 12, country: 'Argentina' },
{ animatorId: 3, firstName: 'Estefanía', lastName: 'Cadh', email: 'estefania@email.com', age: 21, country: 'Argentina' }
];