У меня есть модель EmailModel
Модель класса:
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;
}
}
И я создал переменную emailModel
моего класса EmailModel
.Это мой var: emailModel =< EmailModel>{};
Я получаю неопределенную ошибку, когда использую this.emailModel.product
, но когда я использую this.emailModel.name
или другие свойства, всегда хорошо.