【发布时间】:2018-07-25 19:43:38
【问题描述】:
我想通过下拉菜单将过滤条件传递给ng-repeat
<select class="form-control" ng-model="currentlySelected" ng-change="DropDownChnaged()">
<option value ="">All</option>
<option value="| filter : {deleted_at: null}">Active</option>
<option value="| filter : {deleted_at: '!!'}">Inactive</option>
</select>
查看
<tr ng-repeat="user in users {currentlySelected}">
控制器:
$scope.DropDownChnaged = function () {
$scope.DropDownStatus = $scope.currentlySelected;
alert(currentlySelected.DropDownChnaged);
};
当我手动通过设置过滤器时,它工作正常,但当我尝试动态传递时,它不起作用。
【问题讨论】:
-
这是又一次尝试获得your other question 的答案吗?为什么不直接编写自己的自定义过滤器并完成它?
-
如果我知道该怎么做,我为什么还要问问题?
-
在此站点中搜索
angularjs custom filter。 Here is one implementation 接受多个过滤条件。您可以轻松地将其应用于您的情况。 -
确定 thnx.......
标签: angularjs angularjs-filter