Select2 Bootstrap AngularJS

1

Does anyone use Select2 Bootstrap on AngularJS? I am having a problem ... when I click the options list it shows the correct value that comes from the bank, but in the view always appears the first record. When shooting select2 works fine. >

    
asked by anonymous 24.07.2018 / 03:43

1 answer

1

I do not know exactly how your code is, but I use it this way:

<select chosen="chosen.options" id="especialidade" ng-model="specialty" no-results-text="chosen.empty" class="form-control">
      <option selected ng-click="search(true, false)">{{chosen.specialty}}</option>
      <option ng-repeat="item in specialties" value="{{item.name}}" ng-click="search(true, false)">{{item.name}}</option>
</select>

This first option I place the selected and my tween is a "Select" default text. Already the second option is where I will go through my specialty options.

In my case, when clicking on one of the specialties I have a ng-click that does an action, if you want to just list do not need to use ng-click.

    
24.07.2018 / 14:02