dev
Last change
on this file since 2a9d9d1 was 2a9d9d1, checked in by Стојков Марко <mst@…>, 3 years ago |
Set correct answer for question by question owner
|
-
Property mode
set to
100644
|
File size:
775 bytes
|
Line | |
---|
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
---|
2 | import { VoteType } from 'src/app/shared-app/models';
|
---|
3 | import { ButtonType } from '../button/button.models';
|
---|
4 |
|
---|
5 | @Component({
|
---|
6 | selector: 'app-vote',
|
---|
7 | templateUrl: './vote.component.html',
|
---|
8 | styleUrls: ['./vote.component.scss']
|
---|
9 | })
|
---|
10 | export class VoteComponent implements OnInit {
|
---|
11 | @Input() voteCount: number | undefined;
|
---|
12 | @Input() canSetCorrectAnswer: boolean | null = false;
|
---|
13 | @Input() correct = false;
|
---|
14 | @Output() voteClicked = new EventEmitter<VoteType>();
|
---|
15 | @Output() setCorrectAnswer = new EventEmitter<void>();
|
---|
16 |
|
---|
17 | VoteType = VoteType;
|
---|
18 | ButtonType = ButtonType;
|
---|
19 |
|
---|
20 | constructor() {}
|
---|
21 |
|
---|
22 | ngOnInit(): void {}
|
---|
23 |
|
---|
24 | public voted(voteType: VoteType): void {
|
---|
25 | this.voteClicked.emit(voteType);
|
---|
26 | }
|
---|
27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.