【发布时间】:2016-12-10 10:32:39
【问题描述】:
在我的 AngularJS 网络应用程序中,
Plunker:https://plnkr.co/edit/x9uIx5Inkxxt3fqttkkK?p=preview
我的一个下拉菜单(第一个)没有保留所选值。 html代码片段如下。
我知道这与映射有关 ng-model="entityPropertyType.propertyId"
entityPropertyType 是列表中的迭代值。
HTML
<div class="form-group" ng-repeat="entityPropertyType in advancedSearch.entityPropertyTypes" >
<label class="control-label col-md-1">Business Card</label>
<div class="col-md-2">
<select class="form-control" ng-model="entityPropertyType.propertyId"
ng-change="businessCardSelected($index, entityPropertyType.propertyId)" >
<option value="">Please select</option>
<option ng-repeat="property in businessCards" value="{{property.propertyId}}">{{property.propertyLabel}}</option>
</select>
</div>
</div>
【问题讨论】:
标签: javascript angularjs