I'm struggling to map the JSON data below to an Angular 7 object:
[
{
"id": "123456",
"general": {
"number": "123",
"name": "my name 1",
"description": "My description with <li> html tags </li>"
},
"option1": {
"name": "option1 name"
},
"option2": {
"suboption2": {
"name": "suboption2 name"
}
}
},
{
"id": "789123",
"general": {
"number": "456",
"name": "my name 2",
"description": "My description with <li> html tags </li>"
},
"option1": {
"name": "option2 name"
},
"option2": {
"suboption2": {
"description": "My description with <li> html tags </li>"
}
}
}
]
I attempted to create a MyClass instance using fields that match those in the JSON file and then cast the JSON data to this class, but I encountered challenges along the way.