30 lines
835 B
TypeScript
Raw Normal View History

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";
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,
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');
this.route.data.subscribe((data: {
judges: Array<Judge>,
}) => {
this.judgeService.judges = data.judges.sort((a,b) => a.name.localeCompare(b.name, 'hu-HU'));
});
2018-05-10 16:39:05 +02:00
}
}