I'm trying to convert the following JSON data from an Observable into a typescript Object but it's not converting the embedded JSON into Arrays that are in the Object model. How would I convert this multi-dimensional JSON data into an object?
JSON
[
{
"name": "Fake Name",
"data1": {
"entry1": false,
"entry2": true,
"entry3": "xyz"
},
"data2": {
"entry1": false,
"entry2": true,
},
"data3": {
"entry1": false,
"entry2": true,
"entry3": "xyz"
},
"info1": false,
"info2": "xyz"
},{...}
]
Object
export class NewObject {
public name: string;
public data1: object[];
public data2: object[];
public data3: object[];
public info1: string;
public info2: string;
constructor(name: string, data1: [], data2: [], data3: [],
info1: string, info2: string
) {
this.name = name;
this.data1 = data1;
this.data2 = data2;
this.data3 = data3;
this.info1 = info1;
this.info2 = info2;
}
}