Refactored title service
All checks were successful
Gitea/swiss-client/pipeline/head This commit looks good

This commit is contained in:
2025-08-13 23:40:36 +02:00
parent f88cd94316
commit 26c0c1a2da
16 changed files with 88 additions and 94 deletions

View File

@@ -1,4 +1,4 @@
import {Component, inject, Input, OnInit} from '@angular/core';
import {Component, inject, Input, OnDestroy, OnInit} from '@angular/core';
import {
MatAccordion,
MatExpansionPanel,
@@ -31,7 +31,7 @@ import {MatSnackBar} from "@angular/material/snack-bar";
import {CourtSelectionComponent} from "../court-selection/court-selection.component";
import {Standings} from "../../model/standings";
import {Title} from '@angular/platform-browser';
import {TitleService} from "../../service/title.service";
import {HeaderService} from "../../service/header.service";
@Component({
selector: 'app-tournament-manage',
@@ -71,7 +71,7 @@ import {TitleService} from "../../service/title.service";
templateUrl: './tournament-manage.component.html',
styleUrl: './tournament-manage.component.scss'
})
export class TournamentManageComponent implements OnInit {
export class TournamentManageComponent implements OnInit, OnDestroy {
@Input() tournament: Tournament;
@@ -82,8 +82,7 @@ export class TournamentManageComponent implements OnInit {
private _snackBar: MatSnackBar,
private route: ActivatedRoute,
private router: Router,
private titleService: TitleService,
private title: Title
private headerService: HeaderService,
) {
}
@@ -96,11 +95,14 @@ export class TournamentManageComponent implements OnInit {
})
this.tournamentService.getById(Number(id)).subscribe(data => {
this.tournament = data;
this.titleService.setTitle(this.tournament.name);
this.title.setTitle(this.tournament.name);
this.headerService.setTitle(this.tournament.name);
});
}
ngOnDestroy() {
this.headerService.clearTitle();
}
onRoundTabChange(event: MatTabChangeEvent) {
const index = event.index;
this.router.navigate(