2014-12-08 125 views
-2

如何將默認值設置爲下拉菜單?如何將默認值設置爲下拉菜單?

<div class="row form-group"> 
<label class="col-md-3"><b>NAME<span style="color: #b94a48">*</span></b></label> 
<div class="col-lg-3 col-md-7" style="padding: 0px;"> 
    <div class="dropdown multiple" style="width: 100%;"> 
     <select name="i" class="dropdown multiple" ng-model="i" ng-options="obj.name as obj.name for obj in uniqueMultiSlectStrataList" style="width: 100%;"> 
     <option value="Retail" selected>Retail</option> 
     </select> 
    </div> 
</div> 

回答

1

在控制器

$scope.i = 'Retail'; 

分配一個值ng-model="i"它將使選定