Angular.js ng-repeat根据具有多个值之一的属性进行筛选(值的OR逻辑)。
- 论坛
- Angular.js ng-repeat根据具有多个值之一的属性进行筛选(值的OR逻辑)。
9 浏览
Angular.js ng-repeat根据具有多个值之一的属性进行筛选(值的OR逻辑)。
是否有可能对对象数组进行过滤,使得属性的值可以是几个值之一(或条件),而不需要编写自定义过滤器。这类似于这个问题 - Angular.js ng-repeat :filter by single field
但是,除了
is it possible to do something like this
for a sample data as follows-
$scope.products = [
{ id: 1, name: 'test', color: 'red' },
{ id: 2, name: 'bob', color: 'blue' }
/*... etc... */
];
我尝试了不成功的方法。