title: Using ng-repeat and filter, how to tell which items are visible?
body: <p>I have an array of objects that I'm displaying in my Angular app using <code>ng-repeat</code>. I'm filtering out items using <code>filter</code> and the value of a search input. It works as expected. But, I have a "select all" / "deselect all" option and I only want to select the <em>visibile</em> items in the list (the ones that meet the current search criteria).</p>
  
  <p>Without performing the same logic in my controller (i.e. using <code>indexOf</code> the search value on each of my objects), how can I tell which items are currently filtered out by <code>ng-repeat</code>/<code>filter</code>?</p>
  
  <p>My view:</p>
  
  <pre><code>&lt;input type="text" ng-model="searchValue"&gt;
  &lt;input type="checkbox" ng-model="checkAll" ng-change="toggleAll()"&gt;
  
  &lt;tr ng-repeat="item in items | filter:searchValue"&gt;
      &lt;td&gt;{{item.id}}&lt;/td&gt;
      &lt;td&gt;{{item.name}}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>A function in my controller:</p>
  
  <pre><code>$scope.toggleAll() {
       for(var i in $scope.items){
           // how can I tell if this item is filtered out in the view?
       }
  }
  </code></pre>
  
  <p>I have significantly simplified my code samples here for simplicity since this question doesn't need much more detail. Is there a way to do what I'm thinking or do I need to perform the "search" again?</p>