Dávid Danyi 13af48efbd * locale based sorting implemented
* judge filter in admin now filters in titles aswell
2018-05-14 15:23:09 +02:00

30 lines
835 B
TypeScript

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<Judge>,
}) => {
this.judgeService.judges = data.judges.sort((a,b) => a.name.localeCompare(b.name, 'hu-HU'));
});
}
}