title: Angular js: Access data filtered in ng-repeat (ngRepeat) from controller
body: <p>I need to access data that was already filtered on a template (inside a ng-repeat) from my controller.</p>
  
  <p>Here's what I mean:</p>
  
  <p>I have this table in my template:</p>
  
  <pre><code> &lt;table class="table"&gt;
          &lt;thead&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Gender&lt;/th&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;tr ng-repeat="person in persons | filter:query"&gt;
                  &lt;td&gt;{{person.name}}&lt;/td&gt;
                  &lt;td&gt;{{person.gender}}&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Then I have a <code>&lt;select&gt;</code> that is used to filter data by gender</p>
  
  <pre><code>&lt;h1&gt;Cluster:&lt;/h1&gt;
      &lt;select ng-model="query.gender" &gt;
          &lt;option value =""&gt;ALL&lt;/option&gt;
          &lt;option value ="male"&gt;Male&lt;/option&gt;
          &lt;option value ="female"&gt;Female&lt;/option&gt;
      &lt;/select&gt;
  </code></pre>
  
  <p>This works ok.</p>
  
  <p>If someone selects one of the options, I need to do something with the filtered results.
  That's why I have a $watch in my controller that looks for changes to the filter query:</p>
  
  <pre><code>$scope.$watch('query.gender', function(newValue, oldValue) {
              // Here is where I need to get filtered results
  });
  </code></pre>
  
  <p>My question is:</p>
  
  <p>How do I access the FILTERED content from the controller?</p>
  
  <p>I'd like this preferably without having to do another "filtering" operation in the controller... (since the data was already filtered, the result is sitting somewhere in memory, right?)</p>