Move to new server
This commit is contained in:
14
src/app/pipes/fullname-pipe.ts
Normal file
14
src/app/pipes/fullname-pipe.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
@Pipe({
|
||||
name: 'fullName',
|
||||
standalone: true
|
||||
})
|
||||
export class FullNamePipe implements PipeTransform {
|
||||
transform(person: any, args?: any): any {
|
||||
if (person) {
|
||||
return [person.firstName, person.middleName, person.lastName].join(" ");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/app/pipes/match-result-pipe.ts
Normal file
17
src/app/pipes/match-result-pipe.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Pipe, PipeTransform } from "@angular/core";
|
||||
@Pipe({
|
||||
name: 'matchResult',
|
||||
standalone: true
|
||||
})
|
||||
export class MatchResultPipe implements PipeTransform {
|
||||
transform(match: any, args?: any): any {
|
||||
let result = `${match.games[0].score1} – ${match.games[0].score2}`;
|
||||
result += ` ${match.games[1].score1} – ${match.games[1].score2}`;
|
||||
|
||||
if (match.games[2] != null) {
|
||||
result += ` ${match.games[2].score1} - ${match.games[2].score2}`;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
11
src/app/pipes/status-pipe.ts
Normal file
11
src/app/pipes/status-pipe.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Pipe, PipeTransform } from "@angular/core";
|
||||
@Pipe({
|
||||
name: 'status',
|
||||
standalone: true
|
||||
})
|
||||
export class StatusPipe implements PipeTransform {
|
||||
transform(objectWithStatus: any, args?: any): any {
|
||||
if (objectWithStatus.status == 'NOT_STARTED') return 'Nog niet gestart';
|
||||
return "";
|
||||
}
|
||||
}
|
||||
19
src/app/pipes/team-pipe.ts
Normal file
19
src/app/pipes/team-pipe.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import {FullNamePipe} from "../pipes/fullname-pipe";
|
||||
@Pipe({
|
||||
name: 'teamText',
|
||||
standalone: true
|
||||
})
|
||||
export class TeamPipe implements PipeTransform {
|
||||
|
||||
constructor(private fullNamePipe: FullNamePipe) {}
|
||||
|
||||
transform(team: any, args?: any): any {
|
||||
if (team.player2 != null) {
|
||||
// return this.player1.getFullName() + " / " + this.player2.getFullName();
|
||||
return this.fullNamePipe.transform(team.player1) + " / " + this.fullNamePipe.transform(team.player2);
|
||||
}
|
||||
// return this.player1.getFullName();
|
||||
return this.fullNamePipe.transform(team.player1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user