when we use setvalue in for loop.
Every thing is fine but it gives error:-
Property 'controls' does not exist on type 'AbstractControl'.
Angular 6 How we solve this..
for (let i = 0; i < this.experience.length; i++)
{
if ( i !== 0 ){
const control = <FormArray>this.expGroup.controls['expArray'];
control.push(this.getExp());
}
this.expArray.at(i).controls['company_Name'].setValue(this.experience[i].company_Name);
this.expArray.at(i).controls['position'].setValue(this.experience[i].position);
this.expArray.at(i).controls['employee_id'].setValue(this.experience[i].employee_id);
this.expArray.at(i).controls['time_prefered'].setValue(this.experience[i].time_prefered); this.expArray.at(i).controls['work_exp_year'].setValue(this.experience[i].work_exp_year); this.expArray.at(i).controls['date_of_joining'].setValue(this.experience[i].date_of_joining);
this.expArray.at(i).controls['id'].setValue(this.experience[i].id);
}