Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49248

TypeError: this.validator is not a function

$
0
0

@wakadala wrote:

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!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>