Angular 2 Accessing Nested FormArrays using FormBuilder
<p>First of all I just begin with Angular 2 and I'm trying to build a nested form and validate it.</p>

<p>Here's part of my ts file:</p>

<pre><code>ngOnInit() {
  this.myForm = this.formBuilder.group({
    projects: this.formBuilder.array([
      this.initProjects()
    ])
  });
}

initProjects(): any {
  return this.formBuilder.group({
    name: ['', [Validators.required, Validators.minLength(3)]],
    some_array: this.formBuilder.array([
      this.formBuilder.group({
        name: ['', Validators.required],
        attr: ['', Validators.required],
        some_id: [1, Validators.required]
      })
    ])
  });
}

addProject(): void {
  const control = &lt; FormArray &gt; this.myForm.controls['projects'];
  control.push(this.initProjects());
}
</code></pre>

<p>View:</p>

<pre><code>&lt;form [formGroup]="myForm" novalidate (ngSubmit)="onSubmit(myForm)"&gt;
  &lt;div formArrayName="projects"&gt;
    &lt;div *ngFor="let project of myForm.controls.projects.controls; let i = index"&gt;
      &lt;div [formGroupName]="i"&gt;
        &lt;md-input placeholder="Name" formControlName="name"&gt;&lt;/md-input&gt;
      &lt;/div&gt;
      &lt;div *ngFor="let some_obj of project.controls.some_array.controls; let x = index"&gt;
        &lt;div [formGroupName]="x"&gt;
          &lt;div&gt;
            &lt;md-input placeholder="Nome" formControlName="controls.some_array.controls.name"&gt;&lt;/md-input&gt;
            &lt;small *ngIf="!some_obj.controls.name.valid"&gt;
                    Nome é requerido
                  &lt;/small&gt;
          &lt;/div&gt;
          &lt;md-input type="number" placeholder="Cost" formControlName="controls.some_array.controls.attr" required&gt;&lt;/md-input&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;button type="submit" md-raised-button color="primary" [disabled]="!myForm.valid"&gt;Submit&lt;/button&gt;
&lt;/form&gt;
&lt;pre&gt;form value: &lt;br&gt;{{myForm.value | json}}&lt;/pre&gt;
</code></pre>

<p>The output of form value:</p>

<pre><code>form value: 
{
  "projects": [
    {
      "name": "",
      "some_array": [
        {
          "name": "",
          "attr": "",
          "some_id": 1
        }
      ]
    },
    {
      "name": "",
      "some_array": [
        {
          "name": "",
          "attr": "",
          "some_id": 1
        }
      ]
    }
  ]
}
</code></pre>

<p>Well, as you can see I have some arrays called projects, with 1 array inside each one.</p>

<p>So the problem is that I'm not able to validate each control of some_array array.</p>

<p>Actually I'm getting the following error:</p>

<p>ORIGINAL EXCEPTION: Cannot find control with path: 'projects -> 0 -> controls.some_array.controls.name
PS: I already tried to put it in a div, as below:</p>

<p>
But I also got an error:</p>

<p>Cannot find control with path: 'projects -> some_array'
Thanks in advance. Any help would be appreciated.</p>