title: TypeError: callback is not a function in AngularJS App
body: <p>I'm trying to build my first angular app, I keep getting a error that callback is not a function when trying to save my factory into a service so I can use it for the life of the app.</p>
  
  <p>Here is what I have so far</p>
  
  <pre><code>angular.module('games', ['ui.router', 'ui.bootstrap'])
  .config(function($urlRouterProvider, $locationProvider, $stateProvider) {
      // For any unmatched url, redirect to /state1
      $urlRouterProvider.otherwise("/");
      //take out #
      $locationProvider.html5Mode({
        enabled: true,
        requireBase: false
      });
  
      // Now set up the states
      $stateProvider
          .state('games', {
              url: "/",
              templateUrl: "/static/app/list.html",
              controller: 'gamesCtrl'
          })
      $stateProvider
          .state('game', {
              url: "/games/:title",
              templateUrl: "/static/app/page.html",
              controller: 'pageCtrl'
          })
  })
  
  .controller('gamesCtrl', ['$scope', '$state', 'gamesService',
      function($scope, $state, gamesService) {
           $scope.$state = $state;
           $scope.games = null;
  
           function init() {
             gamesService.getGames().success(function(games) {
               $scope.games = games.data;
               console.log($scope.games.data)
             });
  
           }
           init();
      }
  
  ])
  
  .service('gamesService', ['gamesFactory',
      function(gamesFactory) {
          //grab the list of games on load
          var gamesList = [];
          gamesFactory.getGames().success(function(games) {
              gamesList = games
          });
  
          this.getGames = function(callback){
              callback(gamesList);
          }
      }
  ])
  
  .factory('gamesFactory', function($http) {
      var factory = {};
      factory.getGames = function() {
          return $http.get('/games.json');
      };
      return factory;
  });
  </code></pre>
  
  <p>My error is occuring here </p>
  
  <pre><code>.service('gamesService', ['gamesFactory',
      function(gamesFactory) {
          //grab the list of games on load
          var gamesList = [];
          gamesFactory.getGames().success(function(games) {
              gamesList = games
          });
  
          this.getGames = function(callback){
              callback(gamesList);
          }
      }
  ])
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>