mirror of
https://github.com/AIR-EISTI/hades.git
synced 2025-02-23 05:46:22 +01:00
22 lines
490 B
TypeScript
22 lines
490 B
TypeScript
import { HttpClient } from '@angular/common/http';
|
|
import { Observable } from 'rxjs';
|
|
import { Injectable } from '@angular/core';
|
|
import { GameList, Game } from '../models/game';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class GameService {
|
|
|
|
constructor(private http: HttpClient) {
|
|
|
|
}
|
|
|
|
getGames(): Observable<GameList> {
|
|
return this.http.get<GameList>('/api/games');
|
|
}
|
|
|
|
getGame(gameName): Observable<Game> {
|
|
return this.http.get<Game>(`/api/games/${gameName}`);
|
|
}
|
|
}
|