40 lines
745 B
TypeScript
40 lines
745 B
TypeScript
import {Injectable} from '@angular/core';
|
|
|
|
/**
|
|
* une option de date dans les sondages spéciaux
|
|
*/
|
|
export interface DateOption {
|
|
text: string;
|
|
start?: string;
|
|
end?: string;
|
|
}
|
|
|
|
/**
|
|
* le service transverse à chaque page qui permet de syncroniser la configuration de sondage souhaitée
|
|
*/
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class ConfigService {
|
|
step = 0;
|
|
stepMax = 3;
|
|
pollType = 'classic';
|
|
title = '';
|
|
description = '';
|
|
allowSeveralHours = false;
|
|
dateList: DateOption[] = [];
|
|
|
|
constructor() {
|
|
}
|
|
|
|
set(key, val) {
|
|
this[key] = val;
|
|
}
|
|
|
|
sendForm() {
|
|
// todo
|
|
console.log('sends the form');
|
|
alert('envoi de formulaire en XHR à faire');
|
|
}
|
|
}
|