Select2.js does not select default value in DropDown

0

Good morning,

I'm going to use select2.full.js and select2.css is an angle module.

The problem is that when the dropdown is displayed, the default value selected in the option does not appear. But if it appears when I click on the DropDown there if the selected value appears but I also want it to appear initialized when the dropdown is loaded.

I'm going to put two images to make it better understood

Does anyone know what the problem is?

Thank you very much

    
asked by Reynier Téllez 06.02.2017 в 10:38
source

2 answers

1
<select ng-model="vm.producto.selected">
<option ng-repeat="producto in vm.productos">{{producto.descripcion}}</option>
</select>

vm.productos = [{id:0, descripcion:"producto1"},{id:2, descripcion:"producto2"}];    
vm.producto.selected = vm.productos[0];

with this the product1 will appear by default in the combo ... !!!

    
answered by 11.02.2017 в 06:30
0

The code is the following the class wn_dropdown-box is the one that applies the styles of the select2

<div class="wn_dropdown-box">
              <select ng-model="wifiGuestAdvanced.wifiArrayInfo[0].ui_security_type" class="wn_dropdown" style="width: 100%" ng-change="wifiGuestAdvanced.getArrayEncryptionMode(wifiGuestAdvanced.wifiArrayInfo[0].ui_security_type)">
                <option ng-repeat="types in wifiGuestAdvanced.wifiGuest[0].possible_security_types">{{types}}</option>
             </select>
            </div>
    
answered by 06.02.2017 в 12:34