I want the Dynamic Forms Cookbook example to work with http service. The error is TypeError: Cannot read property 'forEach' of undefined
where the undefined
is regarding array I'm passing to child component.
Feel free to look it into plunker. I've made a change to original example adding Http service which get data from json file.
What I do wrong here?
questions has to be initialized, and ngOnChanges has to used. AppComponent
this.questions = [];
DynamicFormComponent
ngOnChanges() {
this.form = this.qcs.toFormGroup(this.questions);
}