Various improvements
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Naam</th>
|
||||
<th>Wedstrijden geteld</th>
|
||||
<th>Onderdelen</th>
|
||||
<th>Kosten</th>
|
||||
<th>Betaald</th>
|
||||
@@ -13,6 +14,7 @@
|
||||
@for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) {
|
||||
<tr>
|
||||
<td>{{ tournamentPlayer.name }}</td>
|
||||
<td>{{ tournamentPlayer.counts }}</td>
|
||||
<td>
|
||||
@for (event of tournamentPlayer.events; track event) {
|
||||
{{ event }}
|
||||
|
||||
@@ -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