import { Pipe, PipeTransform } from '@angular/core';
import { AbstractControl, FormArray, FormGroup } from '@angular/forms';

@Pipe({
  name: 'formGroupArray'
})
export class FormGroupArrayPipe implements PipeTransform {
  transform(formArray: AbstractControl): FormGroup[] {
    const myFormArray = formArray as FormArray;
    const forms = myFormArray.controls as FormGroup[];
    return forms;
  }
}
