angular - Exportable class with nested object as property -
i'm trying create exportable class has object property in angular 2. reason can bind form using ngmodel.
for example, if have object:
user: { name: string, address: { street: string, city: string, state: string } }
currently have similar this:
export class user { name: string; address: any; }
is there way make address property same 'user' object without using 'any' tag?
seems simple fix, can't seem find answer.
thank you
you can this:
export class user { name: string; // can single object address: { city: string, street: string, state: string }; // can array addresses: { city: string, street: string, state: string }[]; }
Comments
Post a Comment