0

Angular ui-select is not working. If I select first option 0 it is coming like this..

<h3>New List 2</h3>
  <p>Selected: {{panel.fill}}</p>
  <ui-select id="viewSelector" ng-model="panel.fill" theme="selectize">
    <ui-select-match placeholder="Select">{{$select.selected}}</ui-select-match>
    <ui-select-choices repeat="f in [0,1,2,3,4,5,6,7,8,9,10]">
      <div ng-bind-html="f"></div>
    </ui-select-choices>
  </ui-select>

enter image description here

enter image description here Please see the demo.

http://plnkr.co/edit/CKHbiSQ4tZXTjOyxpyBK?p=preview

Please guide me.

1 Answer 1

3

It doesn't like the number 0 that is your first option, it's a false-y value, which is likely confusing the directive on whether it should display the placeholder or not.

It works as expected if you change your array to be the string representation of the numbers, because string "0" is not false-y:

<ui-select-choices repeat="f in ['0','1','2','3','4','5','6','7','8','9','10']">
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.