28 lines
938 B
TypeScript
28 lines
938 B
TypeScript
import { Component, Input, OnInit } from '@angular/core';
|
|
import { Poll } from '../../../core/models/poll.model';
|
|
import { Answer } from '../../../core/enums/answer.enum';
|
|
import { ModalService } from '../../../core/services/modal.service';
|
|
import { StorageService } from '../../../core/services/storage.service';
|
|
|
|
@Component({
|
|
selector: 'app-poll-results-dinum',
|
|
templateUrl: './poll-results-dinum.component.html',
|
|
styleUrls: ['./poll-results-dinum.component.scss'],
|
|
})
|
|
export class PollResultsDinumComponent implements OnInit {
|
|
@Input() public poll: Poll;
|
|
@Input() public detailledDisplay: boolean = false;
|
|
public answerEnum = Answer;
|
|
constructor(private modalService: ModalService, private storageService: StorageService) {}
|
|
|
|
ngOnInit(): void {}
|
|
|
|
toggleAnswer(choice_id: number, value: string) {
|
|
this.storageService.toggleAnswer(choice_id, value);
|
|
}
|
|
|
|
showAsDate(date_string: string) {
|
|
return new Date(date_string);
|
|
}
|
|
}
|