Various improvements
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Component, Input, OnInit} from '@angular/core';
|
||||
import {CurrencyPipe} from "@angular/common";
|
||||
import {MatSlideToggle, MatSlideToggleChange} from "@angular/material/slide-toggle";
|
||||
import {TournamentService} from "../../service/tournament.service";
|
||||
@@ -19,7 +19,7 @@ import {MatSnackBar} from "@angular/material/snack-bar";
|
||||
})
|
||||
export class TournamentPlayersComponent implements OnInit {
|
||||
|
||||
tournament: Tournament;
|
||||
@Input() tournament: Tournament;
|
||||
|
||||
constructor(
|
||||
private tournamentService: TournamentService,
|
||||
@@ -29,10 +29,11 @@ export class TournamentPlayersComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const id = this.route.snapshot.paramMap.get('id');
|
||||
this.tournamentService.getById(Number(id)).subscribe(data => {
|
||||
this.tournament = data;
|
||||
});
|
||||
console.log('Tournament received from parent:', this.tournament);
|
||||
// const id = this.route.snapshot.paramMap.get('id');
|
||||
// this.tournamentService.getById(Number(id)).subscribe(data => {
|
||||
// this.tournament = data;
|
||||
// });
|
||||
}
|
||||
|
||||
playerPaid($event: MatSlideToggleChange, playerId: number) {
|
||||
|
||||
Reference in New Issue
Block a user