funky-framadate-front/src/app/features/administration/form/form.component.ts

41 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-11-07 15:21:27 +01:00
import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core';
2020-10-29 18:43:19 +01:00
import { Poll } from '../../../core/models/poll.model';
2021-11-07 15:21:27 +01:00
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UuidService } from '../../../core/services/uuid.service';
2020-10-29 18:43:19 +01:00
import { ApiService } from '../../../core/services/api.service';
2020-11-03 16:13:47 +01:00
import { ToastService } from '../../../core/services/toast.service';
2020-11-05 19:13:43 +01:00
import { PollService } from '../../../core/services/poll.service';
import { DOCUMENT } from '@angular/common';
2021-11-07 15:21:27 +01:00
import { ActivatedRoute, Router } from '@angular/router';
2020-10-29 18:43:19 +01:00
@Component({
selector: 'app-admin-form',
templateUrl: './form.component.html',
styleUrls: ['./form.component.scss'],
})
2021-11-07 15:21:27 +01:00
export class FormComponent implements OnInit {
2020-10-29 18:43:19 +01:00
@Input()
public poll?: Poll;
2020-11-03 15:44:08 +01:00
public form: FormGroup;
2020-10-29 21:30:33 +01:00
2020-11-03 16:13:47 +01:00
constructor(
private fb: FormBuilder,
private cd: ChangeDetectorRef,
2021-11-07 15:21:27 +01:00
private uuidService: UuidService,
2020-11-03 16:13:47 +01:00
private toastService: ToastService,
2020-11-05 19:13:43 +01:00
private pollService: PollService,
2020-12-16 17:21:01 +01:00
private router: Router,
2021-11-07 15:21:27 +01:00
public route: ActivatedRoute,
private apiService: ApiService,
@Inject(DOCUMENT) private document: any
2021-11-07 15:21:27 +01:00
) {
this.form = this.pollService.form;
}
2021-11-07 15:21:27 +01:00
ngOnInit(): void {
this.pollService.askInitFormDefault();
}
2021-04-30 11:27:54 +02:00
2021-11-07 15:21:27 +01:00
goNextStep() {}
2020-10-29 18:43:19 +01:00
}