add fake game for browser development
This commit is contained in:
parent
902dca5cc2
commit
401a397945
@ -1,4 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Title } from '@angular/platform-browser';
|
||||||
import { Game } from 'src/app/interfaces/game.interface';
|
import { Game } from 'src/app/interfaces/game.interface';
|
||||||
import { GetGames } from 'src/app/services/go';
|
import { GetGames } from 'src/app/services/go';
|
||||||
|
|
||||||
@ -18,6 +19,17 @@ export class GamesBarComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getGames() {
|
getGames() {
|
||||||
|
if (GetGames == undefined){
|
||||||
|
var fakeGame: Game = {
|
||||||
|
gameId: "Fake Game",
|
||||||
|
title: "Fake game",
|
||||||
|
description: "asdasdasd",
|
||||||
|
image: "gmod.png"
|
||||||
|
}
|
||||||
|
this.games.push(fakeGame)
|
||||||
|
this.activeGame = this.games[0]
|
||||||
|
}
|
||||||
|
else{
|
||||||
GetGames().then((value) => {
|
GetGames().then((value) => {
|
||||||
console.log(value);
|
console.log(value);
|
||||||
this.games = value;
|
this.games = value;
|
||||||
@ -26,4 +38,6 @@ export class GamesBarComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user