【发布时间】:2016-02-20 14:53:10
【问题描述】:
我正在尝试根据数据库值在第二个选择框中选择特定选项。第二个选择框应用了一个过滤器。这会根据在第一个选择框中选择的选项进行过滤
下面是 HTML sn-p:
<select id="select_comptype" class="ticketselectboxwidth select-style" ng-model="t_selectedcomptype" ng-options="comptype.ComplaintTypeName for comptype in complainttypemappinglist | filter: {ComplaintCategoryName: t_selectedcomplaintcategory.ComplaintCategoryName}"></select>
如何根据来自数据库的值 ($scope.ticketdetailforid.ComplaintType) 设置第二个选择框值?我已经尝试了下面的代码,但它没有工作。
$scope.t_selectedcomptype = $filter('filter')($scope.complainttypemappinglist, { ComplaintTypeName: $scope.ticketdetailforid.ComplaintType })[0];
高度赞赏任何帮助。谢谢
【问题讨论】:
-
分享带有问题的 jsFiddle 链接总是有帮助的
标签: javascript jquery angularjs angularjs-filter