I am encountering an issue while attempting to parse the following JSON. When trying to extract the value using the code below, it returns undefined.
Is there a method to successfully parse JSON where the keys contain spaces?
{
"Transport Fee":{
"KARNATAKA":{
"ALL_DISTRICT":{
"ALL_PLACES":{
"amount":4000
}
}
},
"ANDRA":{
"ALL_DISTRICT":{
"ALL_PLACES":{
"amount":100
}
}
},
"MP":{
"ALL_DISTRICT":{
"ALL_PLACES":{
"amount":600
}
}
},
"MAHARASHTRA":{
"ALL_DISTRICT":{
"ALL_PLACES":{
"amount":600
}
}
}
}
}
var promise=feeService.getTraspotaionFee();
promise.then(function(data){
$scope.charge=data;
console.log($scope.charge.data["Transport Fee"]["KARNATAKA"]["ALL_DISTRICT"]["amount"]);
});