import { Component, OnInit } from '@angular/core';
import {FormBuilder, Validators} from '@angular/forms';
import {CustomValidators} from 'ng2-validation';
import {FrameAbstractComponent} from '../../../frame/FrameAbstractComponent';

@Component({
  selector: 'app-cf-subject',
  templateUrl: './cf-subject.component.html',
  styleUrls: ['./cf-subject.component.scss']
})
export class CfSubjectComponent extends FrameAbstractComponent {

  initSubject = { subject_type: 'Active'}

  constructor(fb: FormBuilder) {
    super();
    this.valForm = fb.group({
      'subject_name': [null, Validators.compose([Validators.required, CustomValidators.rangeLength([1, 32])])],
      'subject_type': [null, Validators.required],
      'subject_status': [null, Validators.required]
    });
  }

}
