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

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

  initCategory = {max_major_count: 1, max_aspect_count: 1, category_status: 'Active'}

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

}
