I need to store multiple addresses, like address1
, address2
and zipcode
etc.
Should I declare all the fields individually?
for instance:
class A{
// many fields
Address1:string;
Address2:string;
zipCode:number;
city:String;
}
or is there any better way to declare them in entity class? I have been told creating entity classes is the best practice.
morsor :
If only the addresses are multiple, it seems you have this situation:\nclass A {\n AddressList: string[];\n zipCode: number;\n city: String;\n}\n",
2021-11-03T07:25:39
androidavid :
Have you tried something like this?\nclass Address {\n//...\n zipCode: string;\n city: string; \n// ...\n}\n\nclass A {\n addresses: Address[]\n}\n",
2021-11-03T07:14:31