title: Using scope values with filters
body: <p>I am in the need of a filter that filters the shown results within a table, using ngRepeat.
  I want to filter those results based on a user input.</p>
  
  <p>At this point, i am doing things like this:</p>
  
  <pre><code>//HTML
  &lt;input type="search" ng-model="search"&gt;
  
  &lt;table&gt;
    &lt;tr ng-repeat="person in clients | filter: searchFilter"&gt;
      &lt;td&gt;&lt;input type="text" ng-model="person.Vorname"&gt;&lt;/td&gt;            
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The controller / Filter function:</p>
  
  <pre><code>app.controller('MyCtrl',function($scope){
    $scope.searchFilter = function (obj) {
      var re = new RegExp($scope.search, 'i');
      return !$scope.search || re.test(obj.Vorname) || re.test(obj.Firma);
    };
  });
  </code></pre>
  
  <p>Everythings works just fine. However, i am unsure whether i am doing this the right way.</p>
  
  <p>Should i move my filter function to an actual angular.filter for the sake of standards compliance?</p>
  
  <p>If so, how should i pass the value from my input element to the filter? I am aware that i <em>could</em> pass the scope itself, but this seems somehow wrong / too dependent from the scope.</p>
  
  <p>What is the way to go here?</p>