title: how do i pass scope from controller to service in angularjs?
body: <p>I have the following controller: </p>
  
  <pre><code>'use strict';
  
    /* Controllers */
  
    angular.module('stocks.controllers', []).
      controller('MyCtrl1', ['$scope', '$http', 'stockData', function MyCtrl1 ($scope, $http, stockData) {
  
          $scope.submit = function() {
  
  
  
  
          $scope.info = stockData.query();
          console.dir($scope.info);
          }
  
      }]);
  </code></pre>
  
  <p>and i want to pass a bound ng-model that sits in my view called <code>ng-model="symbol_wanted"</code> to the following service...</p>
  
  <pre><code>'use strict';
  
      /* Services */
  
      angular.module('stocks.services', ['ngResource']).factory('stockData', ['$resource',
        function($resource){
          return $resource('http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22YHOO%22)%0A%09%09&amp;env=http%3A%2F%2Fdatatables.org%2Falltables.env&amp;format=json', {}, {
          query: {method:'GET', isArray:false}
        });
      }]);
  </code></pre>
  
  <p>how do i connect the controller's scope to get passed into the service? thanks!</p>