title: Angular JS input ng-model search bug
body: <p>I am experimenting with MEAN (<a href="http://mean.io" rel="nofollow">mean.io</a>). I am using the search model like so (basically like <a href="http://docs.angularjs.org/api/ng.filter%3afilter" rel="nofollow">this</a>):</p>
  
  <pre><code>&lt;section data-ng-controller="JobsController" data-ng-init="find()"&gt;
      Search: &lt;input ng-model="search.$"&gt;&lt;br&gt;
      Search Tag: &lt;input ng-model="search.tag"&gt;
      &lt;ul class="jobs unstyled"&gt;
          &lt;li id="searchObjResults" data-ng-repeat="jobObj in jobs | filter:search"&gt;
              &lt;span&gt;{{jobObj.created | date:'medium'}}&lt;/span&gt; /
              &lt;span&gt;{{jobObj.user.name}}&lt;/span&gt;
              &lt;h2&gt;&lt;a data-ng-href="#!/jobs/{{job._id}}"&gt;{{jobObj.title}}&lt;/a&gt;&lt;/h2&gt;
              &lt;div&gt;{{jobObj.content}}&lt;/div&gt;
              &lt;div&gt;{{jobObj.reward}}&lt;/div&gt;
              &lt;div&gt;{{jobObj.tag}}&lt;/div&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>The <code>JobsController</code> is being used, specifically - the <code>find</code> function, defined in the <code>JobsController</code>, is being called upon load. Here is that function:</p>
  
  <pre><code>$scope.find = function() {
      Jobs.query(function(jobs) {
          $scope.jobs = jobs;
      });
  };
  </code></pre>
  
  <p>When I search for something using the first input, next to "Search:" - if I type in something, it filters, and when I erase everything from the input, the whole unfiltered database shows up again.</p>
  
  <p>However, when I use the input next to "Search Tag:" - it doesn't repopulate the list to its unfiltered state once I erase everything from the input field. I have to refresh the page to get the unfiltered list back.</p>
  
  <p>The example <a href="http://docs.angularjs.org/api/ng.filter%3afilter" rel="nofollow">here</a> has a demo at the bottom, which is very close to mine, but in the demo - it repopulates the list after you erase the input from "Name only" or "Phone only" - which is how I want it to work with <code>search.tag</code>.</p>