funky-framadate-front/src/app/features/consultation/choice-table/choice-table.component.ts

22 lines
589 B
TypeScript
Raw Normal View History

2022-02-10 12:16:11 +01:00
import { Component, Input, OnInit } from '@angular/core';
import { Choice } from '../../../core/models/choice.model';
@Component({
selector: 'app-choice-table',
templateUrl: './choice-table.component.html',
styleUrls: ['./choice-table.component.scss'],
})
export class ChoiceTableComponent implements OnInit {
@Input() detailledDisplay: boolean;
@Input() choice: Choice;
2022-02-11 09:36:22 +01:00
@Input() countMaxVotesForThisAnswer: number = 5;
2022-02-10 12:16:11 +01:00
constructor() {}
ngOnInit(): void {}
2022-02-11 09:36:22 +01:00
roundToPercentWidth(number: number) {
return Math.ceil((number / this.countMaxVotesForThisAnswer) * 100) + '%';
}
2022-02-10 12:16:11 +01:00
}