title: Return result to parent function
body: <p>I have been pulling my hair out here. I am using ion-autocomplete and want to pull data with a factory.</p>
  
  <p>My Factory ...</p>
  
  <pre><code>myApp.factory('items', function($http){
     return {
        list: function(query,callback){
          $http.get('http://192.168.100.100/myApp/products/' + query).success(callback)
          }
          };
          });
  </code></pre>
  
  <p>To get the data I use ..</p>
  
  <pre><code>   items.list(function(items) {
        $scope.items = items;
      });
  </code></pre>
  
  <p>The demo for autocomplete request data like ..</p>
  
  <pre><code>  $scope.getTestItems = function (query) {
                      return {
                          items: [
                              {id: "1", name: query + "1", view: "view: " + query + "1"},
                              {id: "2", name: query + "2", view: "view: " + query + "2"},
                              {id: "3", name: query + "3", view: "view: " + query + "3"}]
                      };
                  };
  </code></pre>
  
  <p>So I figure this is a workable solution ..</p>
  
  <pre><code>   $scope.getTestItems = items.list(query,function(items)
          {   
          console.log(items);
          return items;
          }
          )
  </code></pre>
  
  <p>but clearly is not. I have tried ..</p>
  
  <pre><code>   $scope.getTestItems = function(query)
     {
     items.list(query,function(items)
          {   
          console.log(items);
          return items;
          }
          )
      }
  </code></pre>
  
  <p>Which does give me a console of the result but this is not returned to <code>getTestItems</code></p>