<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Brocco/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Brocco">@Brocco</a> ,<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jmachnik/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jmachnik">@jmachnik</a><br>
First of all I just begin with Angular 2 and I'm trying to build a nested form and validate it.I had posted this question on stackoverflow but dint got any reply so raising this question as a bug .Please revert with the solution as soon as possible .Thank you<br>
Here's part of my ts file:</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/NgOnInit/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/NgOnInit">@NgOnInit</a>() {<br>
this.myForm = this.formBuilder.group({<br>
projects: this.formBuilder.array([<br>
this.initProjects()<br>
])<br>
});<br>
}</p>
<p dir="auto">initProjects(): any {<br>
return this.formBuilder.group({<br>
name: ['', [Validators.required, Validators.minLength(3)]],<br>
some_array: this.formBuilder.array([<br>
this.formBuilder.group({<br>
name: ['', Validators.required],<br>
attr: ['', Validators.required],<br>
some_id: [1, Validators.required]<br>
})<br>
])<br>
});<br>
}</p>
<p dir="auto">addProject(): void {<br>
const control = &lt; FormArray &gt; this.myForm.controls['projects'];<br>
control.push(this.initProjects());<br>
}</p>
<p dir="auto">View:</p>
<p dir="auto">Nome é requerido<br>
Submit<br>
form value:<br>
{{myForm.value | json}}<br>
form value:<br>
{<br>
"projects": [<br>
{<br>
"name": "",<br>
"some_array": [<br>
{<br>
"name": "",<br>
"attr": "",<br>
"some_id": 1<br>
}<br>
]<br>
},<br>
{<br>
"name": "",<br>
"some_array": [<br>
{<br>
"name": "",<br>
"attr": "",<br>
"some_id": 1<br>
}<br>
]<br>
}<br>
]<br>
}</p>
<p dir="auto">Well, as you can see I have some arrays called projects, with 1 array inside each one.</p>
<p dir="auto">So the problem is that I'm not able to validate each control of some_array array.</p>
<p dir="auto">Actually I'm getting the following error:</p>
<p dir="auto">ORIGINAL EXCEPTION: Cannot find control with path: 'projects -&gt; 0 -&gt; controls.some_array.controls.name<br>
PS: I already tried to put it in a div, as below:</p>
<p dir="auto">But I also got an error:</p>
<p dir="auto">Cannot find control with path: 'projects -&gt; some_array'<br>
Thanks in advance. Any help would be appreciated.</p>
<p dir="auto">First of all I just begin with Angular 2 and I'm trying to build a nested form and validate it.I had posted this question on stackoverflow but dint got any reply so raising this question as a bug .Please revert with the solution as soon as possible .Thank you<br>
Here's part of my ts file:</p>
<p dir="auto">ngOnInit() {<br>
this.myForm = this.formBuilder.group({<br>
projects: this.formBuilder.array([<br>
this.initProjects()<br>
])<br>
});<br>
}</p>
<p dir="auto">initProjects(): any {<br>
return this.formBuilder.group({<br>
name: ['', [Validators.required, Validators.minLength(3)]],<br>
some_array: this.formBuilder.array([<br>
this.formBuilder.group({<br>
name: ['', Validators.required],<br>
attr: ['', Validators.required],<br>
some_id: [1, Validators.required]<br>
})<br>
])<br>
});<br>
}</p>
<p dir="auto">addProject(): void {<br>
const control = &lt; FormArray &gt; this.myForm.controls['projects'];<br>
control.push(this.initProjects());<br>
}</p>
<p dir="auto">View:</p>

  <div dir="auto">
    <div dir="auto">
      <div dir="auto">
        
      </div>
      <div dir="auto">
        <div dir="auto">
          <div dir="auto">
            
            
                    Nome é requerido
                  
          </div>
          
        </div>
      </div>
    </div>
  </div>
  Submit

<pre class="notranslate">form value: <br>{{myForm.value | json}}</pre>
<p dir="auto">form value:<br>
{<br>
"projects": [<br>
{<br>
"name": "",<br>
"some_array": [<br>
{<br>
"name": "",<br>
"attr": "",<br>
"some_id": 1<br>
}<br>
]<br>
},<br>
{<br>
"name": "",<br>
"some_array": [<br>
{<br>
"name": "",<br>
"attr": "",<br>
"some_id": 1<br>
}<br>
]<br>
}<br>
]<br>
}</p>
<p dir="auto">Well, as you can see I have some arrays called projects, with 1 array inside each one.</p>
<p dir="auto">So the problem is that I'm not able to validate each control of some_array array.</p>
<p dir="auto">Actually I'm getting the following error:</p>
<p dir="auto">ORIGINAL EXCEPTION: Cannot find control with path: 'projects -&gt; 0 -&gt; controls.some_array.controls.name<br>
PS: I already tried to put it in a div, as below:</p>
<div dir="auto">
<p dir="auto">But I also got an error:</p>
<p dir="auto">Cannot find control with path: 'projects -&gt; some_array'<br>
Thanks in advance. Any help would be appreciated.</p></div>