title: ERROR TypeError: this.validator is not a function FormArray
body: <p>I have an error that only happens when the control is inside a formArray, I have a mat-select to select the days of the week, and it is because of this control that I get the following error.</p>
  
  <p><strong>What am I doing wrong to cause this error to occur?</strong></p>
  
  <pre><code>vendor.js:65387 ERROR TypeError: this.validator is not a function
      at FormControl._runValidator (vendor.js:106921)
      at FormControl.updateValueAndValidity (vendor.js:106882)
      at new FormControl (vendor.js:107326)
      at FormBuilder.control (vendor.js:111089)
      at FormBuilder._createControl (vendor.js:111149)
      at vendor.js:111128
      at Array.forEach (&lt;anonymous&gt;)
      at FormBuilder._reduceControls (vendor.js:111123)
      at FormBuilder.group (vendor.js:111041)
      at :4200/admin-admin-module.js:7871
  </code></pre>
  
  <p>The return that comes within the object <code>element</code> that is in the <code>professionals.forEach</code> is;</p>
  
  <pre><code>  element: {
          daysService: [2, 3],
          endService: "",
          id: "45ySYbmImayrgv7teqWr",
          startService: "",
          name: "Name professional",
          rooms: [],
      };
  </code></pre>
  
  <p><strong>form.component.ts:</strong></p>
  
  <pre><code>  this.weekDays = [
      { label: 'Sunday', value: 0 },
      { label: 'Monday', value: 1 },
      { label: 'Tuesday', value: 2 },
      { label: 'Wednesday', value: 3 },
      { label: 'Thursday', value: 4 },
      { label: 'Friday', value: 5 },
      { label: 'Saturday', value: 6 },
    ];
  
  this.professionals
    .pipe(takeUntil(this._unsubscribeAll))
    .subscribe(professionals =&gt; {
      if (!professionals) return;
      this.setProfessionalsUnity(professionals);
    });
  
  
  
   private _buildForm(): void {
      this.form = this._formBuilder.group({
        professionals: this._formBuilder.array([])
      });
    }
  
    get professionalsArray() {
      return &lt;FormArray&gt;this.form.get('professionals');
    }
  
    public setProfessionalsUnity(professionals): void {
      this.professionalsArray.clear();
      let control = this.professionalsArray;
      if (!professionals) return;
      professionals.forEach(element =&gt; {
        // I believe the error is happening because of this line ...
        control.push(this._formBuilder.group(element));
      });
    }
  
   public addGroupProfessional() {
      return this._formBuilder.group({
        id: [''],
        name: [''],
        rooms: [''],
        daysService: [''],
        startService: [''],
        endService: ['']
      });
    }
  </code></pre>
  
  <p><strong>form.html:</strong></p>
  
  <pre><code>&lt;form [formGroup]="form"&gt;
  
    &lt;mat-accordion formArrayName="professionals"&gt;
      &lt;mat-expansion-panel *ngFor="let group of professionalArray.controls; let i = index" [formGroupName]="i"
        [expanded]="indexExpanded == i &amp;&amp; newProfessional"&gt;
        &lt;mat-expansion-panel-header&gt;
          &lt;mat-panel-title&gt;
            &lt;mat-icon class="secondary-text mr-12"&gt;person&lt;/mat-icon&gt;
            {{ group.get('name').value }}
          &lt;/mat-panel-title&gt;
          &lt;mat-panel-description&gt;
          &lt;/mat-panel-description&gt;
        &lt;/mat-expansion-panel-header&gt;
  
        &lt;div fxLayout="row" fxLayoutAlign="start"&gt;
          &lt;mat-form-field fxFlex="50"&gt;
            &lt;input matInput placeholder="Name of professional..." formControlName="name"&gt;
          &lt;/mat-form-field&gt;
        &lt;/div&gt;
  
        &lt;div class="h3 blue-fg mb-12"&gt;Attendance&lt;/div&gt;
  
        &lt;div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="start"&gt;
          &lt;mat-form-field fxFlex="50"&gt;
            &lt;mat-select placeholder="Days you attend" formControlName="daysService" multiple&gt;
              &lt;mat-option *ngFor="let day of weekDays" [value]="day.value"&gt;{{day.label}}&lt;/mat-option&gt;
            &lt;/mat-select&gt;
          &lt;/mat-form-field&gt;
        &lt;/div&gt;
  
        &lt;mat-action-row&gt;
          &lt;button mat-button color="warn" (click)="removeProfessional(i)" *ngIf="group.value.id"&gt;Delete&lt;/button&gt;
          &lt;button mat-button color="accent" [disabled]="group.value.name.length &lt; 5" *ngIf="group.value.id"
            (click)="updateProfessional(i)"&gt;Save&lt;/button&gt;
          &lt;button mat-button color="accent" [disabled]="group.value.name.length &lt; 5" *ngIf="!group.value.id"
            (click)="addProfessional(i)"&gt;Add&lt;/button&gt;
        &lt;/mat-action-row&gt;
      &lt;/mat-expansion-panel&gt;
    &lt;/mat-accordion&gt;
  
  &lt;/form&gt;
  </code></pre>