用于布尔真或假或全部的AngularJS过滤器

用于布尔真或假或全部的AngularJS过滤器,angularjs,filter,Angularjs,Filter,我使用这个ngRepeat,现在我将过滤communicationUserConnections,其中执行的communicationUserConnection为真。 有可能这样做吗 data-ng-repeat="communicationUserConnection in vm.communicationUserConnections | filter:executed=vm.mySelectedValue. 如果vm.mySelectedValue为true,则在执行时显示所有comm

我使用这个ngRepeat,现在我将过滤communicationUserConnections,其中执行的communicationUserConnection为真。 有可能这样做吗

data-ng-repeat="communicationUserConnection in vm.communicationUserConnections | filter:executed=vm.mySelectedValue.
如果vm.mySelectedValue为true,则在执行时显示所有communicationUserConnection==true,否则显示所有communicationUserConnection的

尝试以下操作:

data-ng-repeat="communicationUserConnection in vm.communicationUserConnections |filter:{'executed':vm.mySelectedValue}"

Try | filter:executed:vm.mySelectedValue。或者,您可以始终创建一个过滤器函数,并在控制器中处理它。