在 AngularJS Controller 中有以下内容:
$scope.initiatives = _.where($scope.initiatives, {i_status_id:'Open'});
如果属性值恰好是“打开”,则可以根据字段过滤列表。
您如何在过滤器值中使用通配符,以便在我搜索包含“打开”的所有内容时选择“打开 - 待定”?
最佳答案
您可以使用 _.filter
反而。就像是:
$scope.initiatives = _.filter($scope.initiatives, function(initiative){
return initiative.i_status_id.indexOf('Open')>=0;
});
关于angularjs - Underscorejs _.where 带通配符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16823849/