2018-05-10 16:39:05 +02:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2018-05-11 10:46:27 +02:00
|
|
|
import { Title } from "@angular/platform-browser";
|
|
|
|
|
import { ActivatedRoute } from "@angular/router";
|
2018-05-11 18:22:59 +02:00
|
|
|
|
|
|
|
|
import { Judge } from "../shared/judge";
|
2018-05-11 10:46:27 +02:00
|
|
|
import { JudgeService } from "../shared/judge.service";
|
2018-05-10 16:39:05 +02:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-judge-list',
|
|
|
|
|
templateUrl: './judge-list.component.html',
|
|
|
|
|
styleUrls: ['./judge-list.component.css']
|
|
|
|
|
})
|
|
|
|
|
export class JudgeListComponent implements OnInit {
|
|
|
|
|
|
2018-05-11 10:46:27 +02:00
|
|
|
constructor(
|
|
|
|
|
private judgeService: JudgeService,
|
|
|
|
|
private titleService: Title,
|
2018-05-11 18:22:59 +02:00
|
|
|
private route: ActivatedRoute,
|
2018-05-11 10:46:27 +02:00
|
|
|
) { }
|
2018-05-10 16:39:05 +02:00
|
|
|
|
|
|
|
|
ngOnInit() {
|
2018-05-11 10:46:27 +02:00
|
|
|
this.titleService.setTitle('Judge list');
|
2018-05-11 18:22:59 +02:00
|
|
|
this.route.data.subscribe((data: {
|
|
|
|
|
judges: Array<Judge>,
|
|
|
|
|
}) => {
|
2018-05-14 15:23:09 +02:00
|
|
|
this.judgeService.judges = data.judges.sort((a,b) => a.name.localeCompare(b.name, 'hu-HU'));
|
2018-05-11 18:22:59 +02:00
|
|
|
});
|
2018-05-10 16:39:05 +02:00
|
|
|
}
|
|
|
|
|
}
|