【发布时间】:2018-11-13 08:53:47
【问题描述】:
我正在使用 AngularJS。我有一个选择标签。标签的值由ng-model 绑定。 ng-model 变量有一个值(来自服务器)。该值不会显示在选择下拉标签中。它虽然显示在一个普通的文本框中。
如何让ng-model 值(下例为“蓝色”)显示在下拉列表中?
请参考-http://jsfiddle.net/9w5XT/2446/
<select ng-model="blisterPackTemplateSelected"
data-ng-options="blisterPackTemplate as blisterPackTemplate.name for
blisterPackTemplate in blisterPackTemplates">
<option value="">Select Account</option>
</select>
<hr>
<input type="text" ng-model="blisterPackTemplateSelected" />
【问题讨论】:
-
使用
标签: angularjs select dropdown angularjs-ng-model