I was implemented the code from this link http://plnkr.co/edit/yV94ZjypwBgHAlb0RLK2?p=preview but getting push and controls error.
Here is what i did and don\'t know wha
Typescript complains on type checking. You need to cast your control to FormArray
. So change
1)
this.surveyForm.controls['questions'].push(question);
to
(<FormArray>this.surveyForm.controls['questions']).push(question);
or
(this.surveyForm.controls['questions'] as FormArray).push(question);
or
(this.surveyForm.get('questions') as FormArray).push(question);
2)
const answers = <FormArray>this.surveyForm.controls.questions.controls[index].controls.answer_ids
to
const answers = this.surveyForm.get(['questions', index, 'answer_ids']) as FormArray;
or
const answers = this.surveyForm.get(`questions.${index}.answer_ids`) as FormArray;
Forked Plunker