I have model EmailModel class model :
export class EmailModel {
public name: String;
public lastname: String;
public address: String;
public company: String;
public zipcode: number;
public city: String;
public phonenumber: number;
public email: String;
public product: ProductModelOrder[] = [];
constructor(name: String, lastname: String, address: String, company: String, zipcode: number, city: String, phonenumber: number, email: String,product: ProductModelOrder[]) {
this.name = name;
this.lastname = lastname;
this.address = address;
this.company = company;
this.zipcode = zipcode;
this.city = city;
this.phonenumber = phonenumber;
this.email = email;
this.product = product;
}
}
And I created the variable emailModel of my class EmailModel.
This is my var: emailModel =< EmailModel>{};
I get the undefined error when I using the this.emailModel.product, but when I using the this.emailModel.name or other properties everting is well.
emailModel =< EmailModel>{};