Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJs按searchform中的键入列进行筛选_Javascript_Angularjs_Filter - Fatal编程技术网

Javascript AngularJs按searchform中的键入列进行筛选

Javascript AngularJs按searchform中的键入列进行筛选,javascript,angularjs,filter,Javascript,Angularjs,Filter,我有一个使用ng repeat的角度列表表。我还有一个搜索所有列的标准搜索表单 <tr ng-repeat="item in test | filter: criteria"> <input type="search" placeholder="Search" ng-model="criteria"> 因此,以某种方式查找冒号,如果找到,则以某种方式更改筛选器。您可以尝试以下方法: filter:{'description':criteria} <input

我有一个使用ng repeat的角度列表表。我还有一个搜索所有列的标准搜索表单

<tr ng-repeat="item in test | filter: criteria">

<input type="search" placeholder="Search" ng-model="criteria">

因此,以某种方式查找冒号,如果找到,则以某种方式更改筛选器。

您可以尝试以下方法:

filter:{'description':criteria}
<input type="text" ng-model='test.age'> Age<br>

<input type="text" ng-model='test.about'> about<br>
<hr>

<table class="table table-striped">
  <tr ng-repeat='item in appVm.users |filter:test'>
  <td>{{item.name}}</td>
  <td>{{item.age}}</td>
  <td>{{item.about}}</td>

  </tr>

看到它在行动吗


这是否足够有用?

为此创建自定义筛选器。请参阅此>
<input type="text" ng-model='test.age'> Age<br>

<input type="text" ng-model='test.about'> about<br>
<hr>

<table class="table table-striped">
  <tr ng-repeat='item in appVm.users |filter:test'>
  <td>{{item.name}}</td>
  <td>{{item.age}}</td>
  <td>{{item.about}}</td>

  </tr>