import { Component, OnInit } from '@angular/core'; import { Title } from "@angular/platform-browser"; import { ActivatedRoute } from "@angular/router"; import { Judge } from "../shared/judge"; import { JudgeService } from "../shared/judge.service"; @Component({ selector: 'app-judge-list', templateUrl: './judge-list.component.html', styleUrls: ['./judge-list.component.css'] }) export class JudgeListComponent implements OnInit { constructor( private judgeService: JudgeService, private titleService: Title, private route: ActivatedRoute, ) { } ngOnInit() { this.titleService.setTitle('Judge list'); this.route.data.subscribe((data: { judges: Array, }) => { this.judgeService.judges = data.judges.sort((a,b) => a.name.localeCompare(b.name, 'hu-HU')); }); } }