title: Angular - Pass input value to factory $http query parameter
body: <p>I have created a factory to run an $http GET method. I need to add an input value to the URL pulling in the JSON but I'm having trouble passing it from the controller. I can see that the URL is being created correctly, I am just missing the "query" parameter from the form input field.</p>
  
  <p>Here is my HTML block:</p>
  
  <pre><code>&lt;input type="string" class="form-control" ng-model="getMovie.title"&gt;
  </code></pre>
  
  <p>Here is my factory and controller:</p>
  
  <pre><code>    var app = angular.module('app', []);
      app.factory("getMovie", ['$http',function($http){
      var obj = {};
      var url = "https://api.nytimes.com/svc/movies/v2/reviews/search.json";
      obj.getMovieInfo = function(){ 
      return $http({
          url: url,
          method: "GET",
          params:{ 
              query: this.title, // This is the value I need
              api_key: "68094e1974e7984c256beb1653319915:3:33678189",
              callback: "JSON_CALLBACK"
        },
          headers: {
              "Content-Type" : "application/json"
          }
       }).then(function successCallback(response) {
              this.movieReviews = response.data.results; 
        }, function errorCallback(response) {
              console.log("Nothing to see here...");
        });
      }
          return obj;
      }]);
  
  app.controller('moviesCtrl', ["$scope", "getMovie", function($scope, getMovie){
      $scope.findMovie = function(){
          getMovie.getMovieInfo().then(function(response){
              $scope.results = response;
          });
      }
  }]);
  </code></pre>
  
  <p>Thanks!</p>