feat: implement basic dice frontend funcionality
This commit is contained in:
parent
dae835cbfa
commit
a62d2092b3
5 changed files with 203 additions and 0 deletions
17
frontend/src/app/feature/game/dice/dice.service.ts
Normal file
17
frontend/src/app/feature/game/dice/dice.service.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { DiceDto, DiceResult } from './dice.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DiceService {
|
||||
private apiUrl = '/backend/dice';
|
||||
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
rollDice(diceDto: DiceDto): Observable<DiceResult> {
|
||||
return this.http.post<DiceResult>(this.apiUrl, diceDto);
|
||||
}
|
||||
}
|
Reference in a new issue