28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import { Component, Input, OnInit } from '@angular/core';
|
|
import { MatDialogConfig } from '@angular/material/dialog';
|
|
|
|
import { Answer } from '../../../core/enums/answer.enum';
|
|
import { Choice } from '../../../core/models/choice.model';
|
|
import { Poll } from '../../../core/models/poll.model';
|
|
import { ModalService } from '../../../core/services/modal.service';
|
|
import { ChoiceDetailsComponent } from '../../../shared/components/choice-details/choice-details.component';
|
|
|
|
@Component({
|
|
selector: 'app-poll-results-compact',
|
|
templateUrl: './poll-results-compact.component.html',
|
|
styleUrls: ['./poll-results-compact.component.scss'],
|
|
})
|
|
export class PollResultsCompactComponent implements OnInit {
|
|
@Input() public poll: Poll;
|
|
public answerEnum = Answer;
|
|
|
|
constructor(private modalService: ModalService) {}
|
|
|
|
ngOnInit(): void {}
|
|
|
|
public openModal(choice: Choice): void {
|
|
const config: MatDialogConfig<Choice> = { data: choice };
|
|
this.modalService.openModal<ChoiceDetailsComponent, Choice>(ChoiceDetailsComponent, config);
|
|
}
|
|
}
|