ajin
ajin

Reputation: 1206

Required modification for angular-select-with-images using ui-select

With reference to this stackoverflow question

The above approved or cleaned up plunker angular-ui-select with images

is not working with 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>

I am getting the below error code.

Error: [ui.select:transcluded] Expected 1 .ui-select-match but got '0'. uishttp://run.plnkr.co/yRjubgwevxwjLaQD/select.js:118:12

Can someone help out..

Upvotes: 2

Views: 237

Answers (1)

ajin
ajin

Reputation: 1206

All the source files has been updated to latest version has solved my problem.

Upvotes: 2

Related Questions