Have problem with converting string to object. I'm getting from the server array of object and some of these objects contains other objects. Problem is that JS reads inner object like a string.
Data structure:
[
{
name: String("Name1"),
key: String("name1"),
value: String("some text")
},
{
name: String("Name2"),
key: String("name2"),
value: [
{
name: String("Object1"),
key: String("object1"),
value: [
{
name: String("Object1 Name3"),
key: String("object1.name3"),
value: Object()
}
]
},
{
name: String("Name4"),
key: String("name4"),
value: String()
},
]
},
{
name: String("Name5"),
key: String("name5"),
value: Number("44")
}
]
Object with Name2 contains other other object like value.
Problem that when I'm trying to display this object tree with Angular object with name ** Object1 Name3** is a string.
How I can convert all data that I'm getting from the server to OBJECT?
This object tree can have up to 5 nested objects and check value of each of them not a solution for me.