import angular from 'angular';
import uiRouter from 'angular-ui-router';
import gameComponent from './game.component';

const gameModule = angular
  .module('game', [uiRouter])
  .config(($stateProvider) => {
    "ngInject";

    $stateProvider.state('game', {
      url: '/game',
      component: 'game'
    });
  })
  .component('game', gameComponent)
  .name;

export default gameModule;

import angular from 'angular';
import uiRouter from 'angular-ui-router';
import gameComponent from './game.component';

const gameModule = angular
  .module('game', [uiRouter])
  .config(($stateProvider) => {
    "ngInject";

    $stateProvider.state('game', {
      url: '/game',
      component: 'game',
      resolve: {
        gameServiceInit: GameService => GameService.initialize()
      },
    });
  })
  .component('game', gameComponent)
  .name;

export default gameModule;

Initialize GameService upon displaying GameComponent
Initialize GameService upon displaying GameComponent
