title: Using resource to populate scope property in Angularjs
body: <p><strong>DISCLAIMER</strong> I'm coming from knockout so I'm having a little trouble switching my train of thought on how to do certain things, this being one of them...</p>
  
  <p>I have an <code>&lt;input&gt;</code> that a user can enter a movie title in and a list of movies should be displayed. The collection of movies is served up from my rest api by calling <code>http://www.example.com/api/movies?title=matrix</code>. The api is wrapped in an angular-resource module.</p>
  
  <p>I thought that <code>$scope.movies = Movie.query({ title: $scope.searchValue });</code> would automatically update anytime <code>$scope.searchValue</code> changed but it doesn't appear to work that way.</p>
  
  <pre><code>angular.module('robotdog.resources', ['ngResource'])
      .factory('Movie', function($resource){
          return $resource('/api/movies/:id');
      });
  
  robotdog.controller('HomeController', function($scope, Movie){
      $scope.movies = Movie.query({ title: $scope.searchValue });
  
  });
  </code></pre>
  
  <p>Just for the sake of completeness here is my markup for this particular controller...</p>
  
  <pre><code>&lt;input type="text" ng-model="searchValue" placeholder="Search Movie Title"/&gt;
  &lt;pre&gt;{{ movies | json }}&lt;/pre&gt;
  </code></pre>
  
  <p><strong>What would be the correct way to populate <code>$scope.movies</code> with the search result after a user has entered a value in the <code>&lt;input&gt;</code>?</strong></p>