【发布时间】:2015-03-22 05:57:44
【问题描述】:
在下面的代码中,更新函数没有得到正确的 ID。
如何在 angularJS 中选择合适的选项。
<select
ng-model="selectedCategory"
size="10"
ng-options="category.id as category.name for category in Categories | orderBy:'name'"
ng-change="update(Categories[selectedCategory-1].id)">
</select>
【问题讨论】:
-
将
selectedCategory传递给您的update函数
标签: javascript angularjs select