import { SelectData } from 'src/app/core/model/select-data.model';
import { Component, OnInit, Inject } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';

@Component({
  selector: 'app-soft-target-type-edit',
  templateUrl: './soft-target-type-edit.component.html',
  styleUrls: ['./soft-target-type-edit.component.scss']
})
export class SoftTargetTypeEditComponent implements OnInit {

  public softTargetTypeForm: FormGroup = this.initSoftTargetTypeForm();
  public softTargetTypes: SelectData[] = [];

  constructor(@Inject(MAT_DIALOG_DATA) private data: any) {
    this.softTargetTypes = data.softTargetTypes;
  }

  ngOnInit() {
  }

  private initSoftTargetTypeForm(){
    let formControls = {
      'softTargetType': new FormControl(null, [Validators.required]),
      'softTargetTypeDetail': new FormControl(null, Validators.maxLength(250)),
    };
    return new FormGroup(formControls);
  }
  
}
