I need to reconstruct this array
var benefits = {
"Emergency services": [
"Emergency room care",
"Ambulance service",
"Urgent care centers/facilities"
],
"Laboratory services": [
"Lab tests & X-ray services",
"Imaging/diagnostics (e.g., MRI, CT scan, PET scan"
],
};
To something like the one below before I display it our to the page with an ng-repeat angular directive
var planBenefit = {
"Emergency services": [
{
benefit: "Emergency room care",
category: "Emergency services",
limit: "",
limit_individual: "",
max_day_limit: "",
plan: "newPlan"
},
{
benefit: "Ambulance service",
category: "Emergency services",
limit: "",
limit_individual: "",
max_day_limit: "",
plan: "newPlan"
},
{
benefit: "Urgent care centers/facilities",
category: "Emergency services",
limit: "",
limit_individual: "",
max_day_limit: "",
plan: "newPlan"
}
],
"Laboratory services": [
{
benefit: "Lab tests & X-ray services",
category: "Laboratory services",
limit: "",
limit_individual: "",
max_day_limit: "",
plan: "newPlan"
},
{
benefit: "Imaging/diagnostics (e.g., MRI, CT scan, PET scan",
category: "Laboratory services",
limit: "",
limit_individual: "",
max_day_limit: "",
plan: "newPlan"
}
]
}
Anyone who can help with this. Am getting the data from an API but I need to display it on the page under the categories in the second array and capture more information before I send it back to a different API and save