28 lines
909 B
TypeScript
28 lines
909 B
TypeScript
import { Component, ChangeDetectionStrategy, inject, signal, OnInit } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
import { DataService } from '../../core/services/data.service';
|
|
import { BetsByTimeComponent } from './bets-by-time/bets-by-time.component';
|
|
import { BetsByGroupComponent } from './bets-by-group/bets-by-group.component';
|
|
|
|
@Component({
|
|
selector: 'app-home',
|
|
standalone: true,
|
|
imports: [CommonModule, BetsByTimeComponent, BetsByGroupComponent],
|
|
templateUrl: './home.component.html',
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
})
|
|
export class HomeComponent implements OnInit {
|
|
private dataService = inject(DataService);
|
|
|
|
viewMode = signal<'time' | 'group'>('time');
|
|
readonly allBets = this.dataService.getActiveBets;
|
|
|
|
ngOnInit() {
|
|
this.dataService.loadUserBets();
|
|
}
|
|
|
|
setViewMode(mode: 'time' | 'group') {
|
|
this.viewMode.set(mode);
|
|
}
|
|
}
|