I have this Json. I want to use in AngularJs but I need modify this before. I tried to use foreach and reordering the objects but the final result is not enought good.
$scope.data = [
{
id: 1,
company: "MOVISTAR",
option: "PRECIO"
},
{
id: 2,
company: "MOVISTAR",
option: "CALIDAD"
},
{
id: 3,
company: "MOVISTAR",
option: "TECNOLOGIA"
},
{
id: 4,
company: "CLARO",
option: "PRECIO"
},
{
id: 5,
company: "CLARO",
option: "CALIDAD"
};
I need format like this
$scope.datax = [
{
empresa: "MOVISTAR",
description:[{
id: 1,
opcionResp: "PRECIO"
},
{
id: 2,
opcionResp: "CALIDAD"
},
{
id: 3,
opcionResp: "TECNOLOGIA"
}]
},
{
empresa: "CLARO",
description:[{
id: 4,
opcionResp: "PRECIO"
},
{
id: 5,
opcionResp: "CALIDAD"
}]
}];
I don't have much experience with json and angular. Help me please.
Thanks so much