I have a simple interface called EmployerContact
. I'm wondering how I can create an empty object, mockEmployerContact
, of type EmployerContact
and then assign values to its properties later on. Do I need to start with default values for this object?
export interface IEmployerContact {
lastName: string;
email: string;
}
...
mockEmployerContact: EmployerContact;
getEmployerContact() {
this.employerService.GetEmployerProposalDetailsFromId(this.employerId, true).subscribe(data => {
this.mockEmployerContact.lastName = data.lastName;
this.mockEmployerContact.email = data.contactEmail;
});
}