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

27 lines
714 B
TypeScript

import { Component, Inject, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { PollService } from '../../../../../core/services/poll.service';
import { DOCUMENT } from '@angular/common';
@Component({
selector: 'app-step-one',
templateUrl: './step-one.component.html',
styleUrls: ['./step-one.component.scss'],
})
export class StepOneComponent implements OnInit {
constructor(public pollService: PollService, @Inject(DOCUMENT) private document: any) {}
@Input()
step_max: any;
@Input()
form: FormGroup;
ngOnInit(): void {
const selector = '#title';
const firstField = this.document.querySelector(selector);
if (firstField) {
firstField.focus();
}
}
}