Move to new server
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user