I have written the following code for in angular for a $http get service call
var country = "http://localhost:3000/json/country.json";
$http.get(timeZoneUrl).then(function (response) {
$ctrl.timezone = response.data;
console.log(response.data);
});
Everything works fine and i am getting response as below.
[{
"region": "Africa",
"country": "South Africa"
},
{
"region": "Europe",
"country": "Spain"
}];
I would like to have the json response massaged and to update the key from the UI. i want the response to be in the following format
[{
"value": "Africa",
"label": "South Africa"
},
{
"value": "Europe",
"label": "Spain"
}];