使用ui-select对图像进行角度选择所需的修改

时间:2016-08-17 13:20:41

标签: angularjs

参考此stackoverflow问题

以上批准或清理的羽毛angular-ui-select with images

无法使用Angular 1.5.8。

    <!DOCTYPE html>
<html lang="en" ng-app="demo">
<head>
  <meta charset="utf-8">
  <title>AngularJS ui-select</title>

  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-sanitize.js"></script>

  <!-- ui-select files -->
  <script src="select.js"></script>
  <link rel="stylesheet" href="select.css">

  <script src="demo.js"></script>

  <!-- Select2 theme -->
  <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">


  <style>
  .select2-search {
      display: none;
    }
  </style>
</head>

<body ng-controller="DemoCtrl">

  <h3>Select2 theme</h3>
  <p>Selected: {{language.selected}}</p>
  <ui-select ng-model="language.selected" theme="select2" ng-disabled="disabled" style="min-width: 300px;">
    <ui-select-match placeholder="Select a language"><img ng-src="{{ $select.selected.url }}" /> {{$select.selected.name}}</ui-select-match>
    <ui-select-choices repeat="lang in language_list">
      <img ng-src="{{ lang.url }}" />
      <div ng-bind-html="lang.name" style="display: inline"></div>
    </ui-select-choices>
  </ui-select>

</body>
</html>

我收到以下错误代码。

  

错误:[ui.select:transcluded]预期1 .ui-select-match但得到'0'。   uishttp://run.plnkr.co/yRjubgwevxwjLaQD/select.js:118:12

有人可以帮帮忙..

1 个答案:

答案 0 :(得分:1)

所有源文件都已更新到最新版本已解决了我的问题。