1

I have tried every possible outcome. But can't get this to work. I am new to web-development, please help out.

I pulled ui-select from github. Added the necessary files (CSS & jS) into my index but still can't get it working. I have read the docs as well. I have also ngSanitize running.

A simple field like this won't appear.

<ui-select ng-model="person.selected" theme="bootstrap">
  <ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
  <ui-select-choices repeat="item in people | filter: $select.search">
    <div ng-bind-html="item.name | highlight: $select.search"></div>
    <small ng-bind-html="item.email | highlight: $select.search"></small>
  </ui-select-choices>
</ui-select>
3
  • seems ok to me. do you have any error in the console? How do you fetch people? Commented Nov 22, 2015 at 14:49
  • @koox00 hi! from a json file. But the field itself <ui-select-match> is not apearing on my browser. I have tried both chrome and firefox Commented Nov 22, 2015 at 14:56
  • can you post also your controller? Commented Nov 22, 2015 at 15:13

2 Answers 2

2

Created a plunkr with your code and it works fine!
Assuming your controller is setup correctly and you inject the ui.select module the code above should work.

Keep in mind that you should load and inject the ng-sanitize module also so that the ng-bind-html directive can be loaded.

Sign up to request clarification or add additional context in comments.

Comments

0

Please check you version of bootstrap

You are using ui-select which need bootstrap 0.14.x

See this link https://stackoverflow.com/a/33134346/4406065

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.