I need to change JSON.
Example of my JSON array:
{
// ...any properties
point: [
location: {
latitude: 0,
longitude: 0
},
name: "Point1",
pointId: 1
]
}
And I loop through the array:
data.points.forEach((formData: IAddress) => {
control.push(this.initiateForm(formData));
});
The obtained result is:
{
location: {
latitude: 0,
longitude: 0
},
name: "Point1",
pointId: 1
}
The desired result is:
{
latitude: 0,
longitude: 0
name: "Point1",
pointId: 1
}
Just remove location JSON as if to eject longitude and latitude from the location.