Modifiche
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { Component, ChangeDetectionStrategy, inject, signal, computed } from '@angular/core';
|
||||
import { Component, ChangeDetectionStrategy, inject, signal, computed, OnInit } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DataService } from '../../core/services/data.service';
|
||||
import { User } from '../../core/models/user.model';
|
||||
import { GroupDetailComponent } from './group-detail/group-detail.component';
|
||||
|
||||
@Component({
|
||||
@@ -11,7 +10,7 @@ import { GroupDetailComponent } from './group-detail/group-detail.component';
|
||||
templateUrl: './groups.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class GroupsComponent {
|
||||
export class GroupsComponent implements OnInit {
|
||||
private dataService = inject(DataService);
|
||||
|
||||
groups = this.dataService.userGroups;
|
||||
@@ -27,6 +26,12 @@ export class GroupsComponent {
|
||||
return this.newGroupName().trim().length > 0 && Object.keys(this.selectedFriendIds()).length > 0;
|
||||
});
|
||||
|
||||
ngOnInit() {
|
||||
this.dataService.loadGroups();
|
||||
this.dataService.loadFriends();
|
||||
this.dataService.loadUserBets();
|
||||
}
|
||||
|
||||
selectGroup(groupId: string) {
|
||||
this.selectedGroupId.set(groupId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user