You can add a field called orderNo
to each object and populate this value with the order you defined after you retrieved the value from API.
[
{
"status": "Yes",
"orderNo": 1,
....
},
{
"status": "Never",
"orderNo": 4,
....
}
]
You can process it in the callback of the $http
or $resource
service like this:
angular.forEach(objects, function(o){
if(o.status === 'Yes') o.orderNo = 1;
else if(o.status === 'Not Now') o.orderNo = 2;
else if(o.status === 'No') o.orderNo = 3;
else if(o.status === 'Never') o.orderNo = 4;
});