funky-framadate-front/src/app/pages/voting/voting-summary/voting-summary.component.ts

41 lines
817 B
TypeScript

import {Component, Input, OnInit} from '@angular/core';
import {ConfigService} from "../../../services/config.service";
import {mockPoll3} from "../../../config/mocks/mock-poll3";
@Component({
selector: 'framadate-voting-summary',
templateUrl: './voting-summary.component.html',
styleUrls: ['./voting-summary.component.scss']
})
export class VotingSummaryComponent implements OnInit {
preferred: string = 'rien';
@Input() pollconfig = mockPoll3;
constructor(public config: ConfigService) {
}
ngOnInit() {
this.computePreferred();
}
getKeys(obj) {
return Object.keys(obj)
}
/**
* find the most "yes"
*/
computePreferred() {
this.pollconfig.stacks.forEach(stack => {
// find the favourite
});
}
}