I hope my explanation will be correct. I have an Array with objects:
$scope.items1 = [
[
{
"answer": "BARCELONA",
"idcustomer": 6,
"order": 1.1
},
{
"answer": "REAL MADRID",
"idcustomer": 6,
"order": 1.4
},
{
"answer": "LYON",
"idcustomer": 6,
"order": 1.2
},
{
"answer": "BAYERN",
"idcustomer": 6,
"order": 1.3
}
],
[
{
"answer": "BENFICA",
"idcustomer": 7,
"order": 1.2
},
{
"answer": "ARSENAL",
"idcustomer": 7,
"order": 1.4
},
{
"answer": "CITY",
"idcustomer": 7,
"order": 1.1
},
{
"answer": "UNITED",
"idcustomer": 7,
"order": 1.3
}
]
];
I need to create a new array with some values of this array.
The final result that I need is: - The first position is the idcostumer. - Sort with order. - The answers with the attribute answer.
$scope.result = [
[6, "BARCELONA", "LYON", "BAYERN", "REAL MADRID"],
[7, "CITY", "BENFICA", "UNITED", "ARSENAL"]
];
Thanks for your help and advices.
