Every time I try to define an array inside the object using dot notation, it keeps showing as undefined
This is my HTML code:
<mat-checkbox *ngFor="let q1 of question.checkboxes;" (change)="checkboxSelected(q1,question,$event)"> {{q1.name}} </mat-checkbox>
Here's my TypeScript code:
checkboxSelected(selected,obj,event){obj.box.push('somecondition') }
An error shows up saying:
ERROR TypeError: Cannot read property 'push' of undefined