Angular js filtering an object by textbox input
<p>I am really new to angular so this may be super simple but I can't seem to get it to work. I have an app that has a search field that needs to actively filter the results as a user types. All of my data is in the searchResults object. Nothing happens when I type in the textbox. What am I missing? Thanks in advance for your help.</p>

<pre><code>&lt;div&gt;
    &lt;input ng-model="query" name="search" id="search" type="text" placeholder="search by product or category"&gt;
    &lt;ul id="filteredResults" ng-if="results.length"&gt;
        &lt;li ng-repeat="result in results | filteredSearchFilter | limitTo: 10"&gt;{{result.name}}&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>filteredSearch.filter.js </p>

<pre><code>module.exports = function() {
  return function(data, keys, query) {
      results = [];
      if( !query ){
        return data;
      } else {
         angular.forEach( data, function( obj ){
            var matched = false;
            angular.forEach( keys, function( key ){
               if( obj[key] ){
                  // match values using angular's built-in filter
                  if ($filter('filter')([obj[key]], query).length &gt; 0){
                     // don't add objects to results twice if multiple
                     // keys have values that match query
                     if( !matched ) {
                        results.push(obj);
                     }
                     matched = true;
                  }
               }
            });
         });
      }
      return results;
    };
</code></pre>