From c048c35b9d6aad8664ecd2fb208f047a1ab3eefc Mon Sep 17 00:00:00 2001 From: tykayn Date: Sat, 10 Aug 2019 11:06:13 +0200 Subject: [PATCH] real example of config --- .../form-container.component.html | 115 ++++++++++-------- .../form-container.component.ts | 71 +++++------ 2 files changed, 98 insertions(+), 88 deletions(-) diff --git a/src/app/form-container/form-container.component.html b/src/app/form-container/form-container.component.html index eb185037..87af83c9 100644 --- a/src/app/form-container/form-container.component.html +++ b/src/app/form-container/form-container.component.html @@ -1,85 +1,92 @@
- -

- titre de question -

- - - blah blah + +

+ titre de question +

+ + Je veux créer un sondage - - - - blah blah blah. + + +
+ + -
- + + + +
+ Choix cornélien: - - - + +


- + infos de debug - -
diff --git a/src/app/form-container/form-container.component.ts b/src/app/form-container/form-container.component.ts index af5d09cf..9b26594f 100644 --- a/src/app/form-container/form-container.component.ts +++ b/src/app/form-container/form-container.component.ts @@ -4,9 +4,9 @@ import {ProgressionService} from '../progression.service'; // import {PollConfig} from '../config/PollConfig'; @Component({ - selector: 'framadate-form-container', - templateUrl: './form-container.component.html', - styleUrls: ['./form-container.component.scss'] + selector: 'framadate-form-container', + templateUrl: './form-container.component.html', + styleUrls: ['./form-container.component.scss'] }) /** * gestion de la progression dans le formulaire. @@ -14,42 +14,45 @@ import {ProgressionService} from '../progression.service'; */ export class FormContainerComponent implements OnInit { - private pollConfig: any = { - poll_type: 'classic', - allow_stuff: true, - }; - private progressionStep = 0; - private progressionStepMax = 0; - private formIsValid = true; + // todo make a class in the config folder of this + private pollConfig: any = { + poll_type: 'classic', + title: '', + description: '', + allow_stuff: true, + }; + private progressionStep = 0; + private progressionStepMax = 0; + private formIsValid = true; - constructor(private progression: ProgressionService) { + constructor(private progression: ProgressionService) { - } - - ngOnInit() { - } - - nextPage() { - if (this.checkValidity()) { - this.progressionStep++; - } else { - this.displayErrorMessage(); } - } - selectOption(key: string, val: any) { - this.pollConfig[key] = val; + ngOnInit() { + } - return true; - } + nextPage() { + if (this.checkValidity()) { + this.progressionStep++; + } else { + this.displayErrorMessage(); + } + } - checkValidity() { - // TODO with form controls - return true; - } + selectOption(key: string, val: any) { + this.pollConfig[key] = val; - displayErrorMessage() { - // TODO - return true; - } + return true; + } + + checkValidity() { + // TODO with form controls + return true; + } + + displayErrorMessage() { + // TODO + return true; + } }