ERROR: Unable to access 'applicants' property of undefined object
When my component initializes, I am attempting to execute the following code:
application: application;
ngOnInit(): void {
this.application.applicants[0].type = "1"; <-- There seems to be an issue here
}
Below are the two classes that I have defined:
export class application{
applicants: applicants[];
constructor(applicants: applicants[]){this.applicants = applicants;}
}
export class applicants{
type: String;
constructor(type: String){this.type = type;}
}