Beispiel #1
0
 startGame() {
   this.game.started = moment();
   this.gameService.save(this.game)
     .then(game => {
         var url = this.router.parent.generate("play-game", {id: game.id});
         return this.router.parent.navigate(url);
     })
 }
Beispiel #2
0
 constructor(gameService: GameService, playerService: PlayerService, private router: Router) {
   playerService.listPlayers()
     .then(players => {
       this.players = players;
     });
   
   gameService.listActiveGames()
     .then(games => {
       this.games = games;
     })
 }