【发布时间】:2019-10-23 21:39:04
【问题描述】:
我在我的控制器上使用这个数组:
var vm = this;
vm.documentGenerationEnum= [
{id:0, name: 'Manual'},
{id:1, name: 'Automatic'}
];
我在 html 上使用它
<select ng-model="vm.editable.DocumentGeneration"
ng-options="option.id as option.name for option in vm.documentGenerationEnum"
class="product-field-input dropdown">
</select>
虽然我得到一个空的下拉列表,这对我来说毫无意义。我很确定代码做得很好,因为这对我来说不是一个新话题。但我不确定还有哪些其他因素会导致这种情况发生,我还可以考虑哪些其他因素?
【问题讨论】:
-
用 ng for? 添加
标签: angularjs ng-options