framadate-responsive/src/app/config/PollConfig.ts

37 lines
723 B
TypeScript
Raw Normal View History

/**
* une option de date dans les sondages spéciaux
*/
export interface DateOption {
text: string;
start?: string;
end?: string;
}
/**
2019-08-10 17:41:01 +02:00
* configuration of the poll, add new fields at will
*/
export class PollConfig {
step = 0;
stepMax = 3;
pollType = 'classic';
title = '';
description = '';
2019-08-10 17:41:01 +02:00
visibility = 'link_only';
// date specific poll
allowSeveralHours = false;
dateList: DateOption[] = [];
answers: string[] = [];
2019-08-10 17:41:01 +02:00
addAnswer() {
this.answers.push('');
}
removeAnswer(answer: string) {
const indexFound = this.answers.indexOf(answer);
if (indexFound !== -1) {
this.answers.splice(indexFound);
}
}
}