Seven price
asked on
initialise the object angular2
export class DashComponents
implements OnInit {
dashtest: IDashPosttest[];
ngOnInit(): void
this works
this.FirstName = "testing it all";
<input type="text" class="form-control" [value]="FirstName" (input)="FirstName = $event.target.value"/>
but this does not work
this.dashtest[0]FirstName = "testing it all"
<input type="text" class="form-control" #firstnameRef="ngModel" [(ngModel)]="dash.FirstNam
export interface IDashPosttest {
FirstName: string;
LastName: string;
}
Error receiving Error: Error in :0:0 caused by: Cannot read property '0' of undefined
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it. Thanks again. have a great holiday.
You are welcome - and to you and your family as well.
ASKER
TypeError: Cannot set property 'FirstName' of undefined