import {Component, OnInit} from '@angular/core'; 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'] }) /** * gestion de la progression dans le formulaire. * à chaque étape correspond un composant de page */ export class FormContainerComponent implements OnInit { private pollConfig: any = { poll_type: 'classic', allow_stuff: true, }; private progressionStep = 0; private progressionStepMax = 0; private formIsValid = true; constructor(private progression: ProgressionService) { } ngOnInit() { } nextPage() { if (this.checkValidity()) { this.progressionStep++; } else { this.displayErrorMessage(); } } selectOption(key: string, val: any) { this.pollConfig[key] = val; return true; } checkValidity() { // TODO with form controls return true; } displayErrorMessage() { // TODO return true; } }