Hi,

I am using angualrjs select with ngoption and ng-model as shown below. It 
works fine with Initial Load. 

<select ng-show="vm.isConditional" class="form-control" style="width:120px 
!important;" data-ng-model="CCR.ccr_fe_readonly" 
ng-change="vm.calculatedFieldResultTypesOnChange(CCR)"
                            ng-options="i.value as i.name for i in 
vm.calculatedFieldResultTypes"></select>

After intial load  if we try to load again one of the value which is 
selected on intial load got deselected and nothing is selected in dropdown. 
After inspecting element i see to options got selected due to which it 
might it not able to display selected value, first item is selected which i 
don't want to be selected.

<select ng-show="vm.isConditional" class="form-control ng-pristine 
ng-untouched ng-valid" style="width:120px !important;" 
data-ng-model="CCR.ccr_fe_readonly" 
ng-change="vm.calculatedFieldResultTypesOnChange(CCR)" ng-options="i.value 
as i.name for i in vm.calculatedFieldResultTypes">
         <option value="0" selected="selected" label="=">=</option>
         <option value="1" selected="selected" 
label="Editable">Editable</option>
         <option value="2" label="Read Only">Read Only</option>
</select>

As you see there are selected options are two. I want only Editable to be 
selected. I check model for this as well it has value of Editable only. Am 
i missing anything here. Please help.

<https://lh3.googleusercontent.com/-YeIfCSsV4Uk/Wg7EeNhOWCI/AAAAAAAAAcc/o9KwR5po1LsN85w9IyfLdzfBHOb4EjUlgCLcBGAs/s1600/TwoSelect.JPG>
 


-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to