When using ng-repeat I want to filter object by two values (name and description). I want to filter this array in way if in any key exists value in search it will return it. When I'm trying this filter:{info:{name:search, description:search}}
the result is when value from search equals in both.
答案 0 :(得分:1)
好的,基于我能够理解的内容。虽然我不确定这是否是你想要的,如果不让我知道,我会删除这个答案。
让我们假设您的对象具有此格式的值,您要向$ cat data
Hi, this is 25 ...
Lalala 21 or 29 what is ... 79?
$ grep -oP '\b\d+\b' data | paste -s -d '+' | bc
154
提供。
ng-repeat
这是我们的HTML部分,添加控制器和所有,我希望不会有问题。
$scope.inputobject = [
{name: 'xyz', description: 'hadhash'},
{name: 'uza', description: 'hadhahdh'},
{name: 'aaa', description: 'hadhahas'}
];
现在过滤器只会根据第一个输入进行。干杯!