This query is different from
https://stackoverflow.com/questions/52235952/cannot-read-property-of-undefined-reactive-forms
Check out the StackBlitz demo here - https://stackblitz.com/edit/github-rbjwcd-wtrevw
I am encountering some challenges with the aforementioned demo. My goal is to make the form builder work with models as shown in the example. The trouble lies with the .group
property.
contactForm: FormGroup;
createFormGroupWithBuilderAndModel(formBuilder: FormBuilder) {
return this.formBuilder.group({
personalData: formBuilder.group(new PersonalData()),
requestType: '',
text: ''
});
}
I suspect that the issue might be related to not initializing the form upon return like so:
this.contactForm = this.formBuilder.group
Can anyone assist in resolving this matter?