Struggling to loop through my formgroups to identify which ones are valid and add the invalid ones to a new array. I can't seem to grab the name value for each formgroup.
this.applicationFormArray = new FormGroup({
selectAppFormGroup:this.selectAppFormGroup = new FormGroup({
}),
generalAppFormGroup:this.generalAppFormGroup = new FormGroup({
}),
fileModeFormGroup:this.fileModeFormGroup = new FormGroup({
}),
accessListFormGroup:this.accessListFormGroup = new FormGroup({
})
});
this.applicationFormGroup.addControl('applicationFormArray', this.applicationFormArray);
checkValidity() {
for (let c of Object.getOwnPropertyNames(this.applicationFormArray.controls)) {
if(!this.applicationFormArray.controls[c].valid) {
var invalidFormGroups = new Array;
var grabFormGroups = console.log(this.applicationFormArray.controls[c].get('?????'));
invalidFormGroups.push(grabFormGroups);
}
}
}