Issue 1:
@Brocco ,@jmachnik

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

Here's part of my ts file:

@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 = < FormArray > this.myForm.controls['projects'];

control.push(this.initProjects());

}

View:

Nome é requerido

Submit

form value:

{{myForm.value | json}}

form value:

{

"projects": [

{

"name": "",

"some_array": [

{

"name": "",

"attr": "",

"some_id": 1

}

]

},

{

"name": "",

"some_array": [

{

"name": "",

"attr": "",

"some_id": 1

}

]

}

]

}

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

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

Actually I'm getting the following error:

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:

But I also got an error:

Cannot find control with path: 'projects -> some_array'

Thanks in advance. Any help would be appreciated.

Issue 2:
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

Here's part of my ts file:

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 = < FormArray > this.myForm.controls['projects'];

control.push(this.initProjects());

}

View:

Nome é requerido

Submit

form value:
{{myForm.value | json}}

form value:

{

"projects": [

{

"name": "",

"some_array": [

{

"name": "",

"attr": "",

"some_id": 1

}

]

},

{

"name": "",

"some_array": [

{

"name": "",

"attr": "",

"some_id": 1

}

]

}

]

}

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

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

Actually I'm getting the following error:

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:

But I also got an error:

Cannot find control with path: 'projects -> some_array'

Thanks in advance. Any help would be appreciated.