I found this problem in many questions in stackoverflow but no luck. Please help me for figuring out what I am doing wrong.
In component :
I tried to generate a form dynamically because the amount of questions depend on an object and for me the error was fixed when I added ngDefaultControl
to my mat-form-field
.
In sendFeedback() I get the value from my dynamic form by selecting the formgroup's value as such
sendFeedbackAsAgent():void {
if (this.questionsForm.valid) {
console.log(this.questionsForm.value)
}
}