【发布时间】:2016-01-27 12:31:57
【问题描述】:
我在使用 Angular ng-options 将 JSON 数据加载到 Dropdown 时得到空白数据。
我的 JSON 值
"tagFormat": {
"displayText": "Tag Format",
"options": [{
"value": "js",
"name": "JS"
}, {
"value": "vast",
"name": "VAST"
}]
},
HTML 视图
<div class="select_padding">
<select class="form-control" ng-options="otf.value as otf.name for otf in details.tagFormat.options">
<option>Select Tag Format</option>
</select>
</div>
这里的 details 是我的作用域变量。
如何获取这些数据以及下次我需要使用选定值时。所以我需要绑定 ng-model 吗?
谢谢
【问题讨论】:
标签: angularjs dropdown angularjs-ng-options