import {Component, inject} from '@angular/core';
import {FormControl, FormRecord, NonNullableFormBuilder, ReactiveFormsModule, Validators} from '@angular/forms';
import {NzColDirective, NzRowDirective} from 'ng-zorro-antd/grid';
import {NzInputDirective} from 'ng-zorro-antd/input';
import {NzFormDirective} from 'ng-zorro-antd/form';
import {NzButtonComponent} from 'ng-zorro-antd/button';
import {NzIconDirective} from 'ng-zorro-antd/icon';

@Component({
  selector: 'app-student-item',
  imports: [
    ReactiveFormsModule,
    NzRowDirective,
    NzColDirective,
    NzInputDirective,
    NzFormDirective,
    NzButtonComponent
  ],
  templateUrl: './student-item.component.html',
  standalone: true,
  styleUrl: './student-item.component.scss'
})
export class StudentItemComponent {

  private fb = inject(NonNullableFormBuilder);
  validateForm = this.fb.group({
    name: this.fb.control('', [Validators.required]),
  });
  constructor() { }

  resetForm(): void {
    this.validateForm.reset();
  }

}
