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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -