koersepublicfrontend/src/app/topmenu/topmenu.component.ts

32 lines
786 B
TypeScript

import {Component, OnInit} from '@angular/core';
import {ChampionshipService} from '../championship.service';
import {ActivatedRoute, Router} from '@angular/router';
@Component({
selector: 'app-topmenu',
templateUrl: './topmenu.component.html',
styleUrls: ['./topmenu.component.scss']
})
export class TopmenuComponent implements OnInit {
private idChampionship: number;
constructor(private championshipService: ChampionshipService,
private route: ActivatedRoute,
private router: Router) {
}
ngOnInit() {
}
currentChampionship(): string {
const currentChampionship = this.championshipService.getCurrentChampionship();
if (currentChampionship) {
return currentChampionship.name;
} else {
return '?';
}
}
}