style: run prettier
This commit is contained in:
parent
bc56b498ee
commit
efc2a8ecec
5 changed files with 49 additions and 44 deletions
|
@ -1,8 +1,8 @@
|
|||
import {ChangeDetectionStrategy, Component, inject, OnInit, signal} from "@angular/core";
|
||||
import {NavbarComponent} from "@shared/components/navbar/navbar.component";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {KeyValuePipe, NgClass, UpperCasePipe} from "@angular/common";
|
||||
import {FormsModule} from "@angular/forms";
|
||||
import { ChangeDetectionStrategy, Component, inject, OnInit, signal } from '@angular/core';
|
||||
import { NavbarComponent } from '@shared/components/navbar/navbar.component';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { KeyValuePipe, NgClass, UpperCasePipe } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
interface SlotResult {
|
||||
status: 'win' | 'lose';
|
||||
|
@ -13,13 +13,7 @@ interface SlotResult {
|
|||
@Component({
|
||||
selector: 'app-slots',
|
||||
standalone: true,
|
||||
imports: [
|
||||
NavbarComponent,
|
||||
KeyValuePipe,
|
||||
UpperCasePipe,
|
||||
NgClass,
|
||||
FormsModule
|
||||
],
|
||||
imports: [NavbarComponent, KeyValuePipe, UpperCasePipe, NgClass, FormsModule],
|
||||
templateUrl: './slots.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
|
@ -30,25 +24,25 @@ export default class SlotsComponent implements OnInit {
|
|||
status: 'lose',
|
||||
amount: 12,
|
||||
resultMatrix: [
|
||||
["BAR", "BAR", "BAR"],
|
||||
["SEVEN", "SEVEN", "SEVEN"],
|
||||
["BELL", "BELL", "BELL"]
|
||||
]
|
||||
['BAR', 'BAR', 'BAR'],
|
||||
['SEVEN', 'SEVEN', 'SEVEN'],
|
||||
['BELL', 'BELL', 'BELL'],
|
||||
],
|
||||
});
|
||||
betAmount = signal<number>(1);
|
||||
|
||||
ngOnInit(): void {
|
||||
this.httpClient.get<Record<string, number>>('/backend/slots/info').subscribe(data => {
|
||||
this.httpClient.get<Record<string, number>>('/backend/slots/info').subscribe((data) => {
|
||||
this.slotInfo.set(data);
|
||||
});
|
||||
}
|
||||
|
||||
spin(): void {
|
||||
const payload = {
|
||||
betAmount: this.betAmount()
|
||||
betAmount: this.betAmount(),
|
||||
};
|
||||
|
||||
this.httpClient.post<SlotResult>('/backend/slots/spin', payload).subscribe(result => {
|
||||
this.httpClient.post<SlotResult>('/backend/slots/spin', payload).subscribe((result) => {
|
||||
this.slotResult.set(result);
|
||||
});
|
||||
}
|
||||
|
|
Reference in a new issue