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 }); } }