Angular 6 - ERROR TypeError: Cannot read property 'value' of undefined
I can't belive that a single '?' ruined my day that's why i'm creating this post . i'll try to make this as simple as i can.
This happens becuse one of your object does'n have the value untill the API response arrives.So use ? to check untill the response arrivesfor example:
question: this.pollForm.get("question")?.value

Comments
Post a Comment