我想从Angular应用程序发送一个JSON
。 json
的结构应为
{"data":{"field1":"d","field2":"d","field3":["d"],"field4":["d"],"field5":["d"],"field6":"d","field7":"d"}}
某些字段是字符串,而其他字段是数组
表示Angular
的{{1}}类是
Data.class
json
Mydata.class
constructor (public field1:string,
public field2:string,
public field3:Array<string>,
public field4:string,
public field5:Array<string>,
public field6:Array<any>,
public field7:string){}
但是,正在发送的export class MyData{
constructor(public data:Data){ }
是json
发送的{"data":{"field1":"d","field2":"d","field3":"d","field4":"d","field5":"d","field6":"d","field7":"d"}}
似乎只包含字符串,而不包含数组。如何发送json
格式的json