title: Convert Angular HTTP.get function to a service
body: <p>I'm trying to convert an Angular <code>HTTP.get</code> function in my <code>controllers.js</code> to a service in <code>services.js</code>.</p>
  
  <p>The examples I have found all have conflicting ways to implement the service and their choice of names is confusing. Furthermore, the actual angular documentation for services uses yet a different syntax than all the examples. I know this is super simple, but please help me out here.</p>
  
  <p>I have <code>app.js</code>, <code>controllers.js</code>, <code>services.js</code>, <code>filters.js</code>.</p>
  
  <p><strong>app.js</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>angular.module('MyApp', []).
      config(['$routeProvider', function($routeProvider)
          {
              $routeProvider.
                  when('/bookslist', {templateUrl: 'partials/bookslist.html', controller:             BooksListCtrl}).
                  otherwise({redirectTo: '/bookslist'});
          }
      ]);
  </code></pre>
  
  <p><strong>controllers.js</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>function BooksListCtrl($scope,$http) {
      $http.get('books.php?action=query').success(function(data) {
          $scope.books = data;
      });
  
      $scope.orderProp = 'author';
  }
  </code></pre>