ui-select内部ng-repeat突出显示第一个弹出窗口中的太多项目

时间:2014-07-11 08:02:32

标签: angularjs angularjs-ng-repeat angular-ui

我在ui-select中遇到以下问题:

  • 下拉列表中的所有选项都以蓝色背景颜色突出显示第一个ui-select元素。

请参阅this plunk

<form>
<div ng-repeat="e in entries">
  <div class="form-group">
    <div class="col-xs-8">
      <ui-select ng-model="e.$account" >
        <ui-select-match>{{ $select.selected.code }}</ui-select-match>
        <ui-select-choices repeat="acct in accounts | filter: $select.search">
            <span ng-bind-html="(acct.code + ' - ' + acct.name) 
                          | highlight: $select.search"></span>
        </ui-select-choices>
      </ui-select>
    </div>
    <div class="col-xs-4">
      <input type="text" class="form-control text-right" ng-model="e.amount"/>
    </div>
  </div>
</div>
</form>

angular.module('demo', ['ui.select'])
.controller('DemoCtrl', ['$scope', '$location', '$timeout', 
function ($scope, $location, $timeout) {
  $scope.accounts = [
    {code: '100',  name: 'Cash'},
    {code: '200',  name: 'Accounts receivable'},
    {code: '300',  name: 'Inventory'}
  ];

  $scope.entries = [
    {'$account': $scope.accounts[0], amount: 500},
    {'$account': $scope.accounts[2], amount: 920}
  ];
}]);

0 个答案:

没有答案