TypeError: this.validator is not a function

I’m iterating through an array of records to dynamically create formGroups for the frontend. I’ve achieved this in submitting the form, but i’m creating the function to edit the submitted results.

TS Defining the form group:

      this.entry = this.formBuilder.group({
        bm: this.formBuilder.array([this.iterateBowel()]),
...

Then for the iterating function:

  iterateBowel(): FormGroup {
    let array = this.recordData[54]; //has the array content to be iterated as values for the form to be edited

    this.iterableArray =  <FormArray>[];
    for(var i = 0; i<array.length; i++){
      let bm = array[i];
       let fg = this.formBuilder.group({
        1: [bm[1], ],
        2: [bm[2], ],
        3: [bm[3], ],
        4: [bm[4], ],
        5: [bm[5], ],
      });
     this.iterableArray.push(fg);
  }
  return this.iterableArray;
  }

With this, I keep getting “this.validator is not a function” error. I also changed values to 1: [[bm[1]], ], etc… but the same error kept showing. Any ideas?

Thanks!

FIGURED IT OUT!!
In case anyone ever lands into this similar issue, here is the right approach:

Deinfing the form:

this.entry = this.formBuilder.group({
        bm: this.formBuilder.array([]),
...

  
  // Take care of BM
    let array = this.recordData[54];
    for(var i = 0; i < array.length; i++){
      let bm = array[i];
      let row = this.formBuilder.group({
        1: [[bm[1]], ],
        2: [[bm[2]], ],
        3: [[bm[3]], ],
        4: [[bm[4]], ],
        5: [[bm[5]], ],
        6: [[bm[6]], ],
        7: [[bm[7]], ],
        8: [[bm[8]], ],
        9: [[bm[9]], ],
        10: [[bm[10]], ],
        11: [[bm[11]], ],
        12: [[bm[12]], ],
        13: [[bm[13]], ],
        14: [[bm[14]], ],
        15: [[bm[15]], ],
        16: [[bm[16]], ],
        17: [[bm[17]], ],
        18: [[bm[18]], ],
        19: [[bm[19]], ],
        20: [[bm[20]], ],
        21: [[bm[21]], ],
        22: [[bm[22]], ],
        23: [[bm[23]], ],
        24: [[bm[24]], ],
        25: [[bm[25]], ],
        26: [[bm[26]], ],
        27: [[bm[27]], ],
        28: [[bm[28]], ],
        29: [[bm[29]], ],
        30: [[bm[30]], ],
        31: [[bm[31]], ],
      });
      (this.entry.get("bm") as FormArray).push(row);
    }