title: AngularjS Services/Factories loaded on startup and not on use
body: <p>I have a problem with my AngularJS app. I have some factories defined which are injected into some controllers (where needed). My Problem is that these factories get initialized when I first startup the application.</p>
  
  <p>One of the services which is causing problems:</p>
  
  <pre><code>PlanningPoker.factory('PokerTable', function ($http) {
  var baseURL = "/api/pokertable/";
  
  return {
      list: function list(playerId) {
          return $http.get(baseURL, {params: {playerid : playerId}});
      },
      save: function save(pokertable) {
          return $http.post(baseURL, pokertable, {});
      }
  };
  </code></pre>
  
  <p>});</p>
  
  <p>This service is used like this in a controller:</p>
  
  <pre><code>PlanningPoker.controller('PokerTableListController', function ($rootScope, $scope, $route, PokerTable, SocketEvent) {
  PokerTable.list($rootScope.playerId).
      success(function (data, status, headers, config) {
          $scope.pokertables = data;
      });
  </code></pre>
  
  <p>});</p>
  
  <p>Also when I remove the PokerTable Service from the controllers callback the Service gets called. I tried this by adding a console.log into the service and it was called no matter if the service was used in any controller or not.</p>
  
  <p>Any ideas on that? I thought services are loaded lazily only if they are needed?</p>
  
  <p>Greets
  Marc</p>