I am getting empty response while reading json content from file please find below snippet which I am using in my code and json file from which I am trying to read data.
$http.get('content/json/environment.json').success(function(data) {
if(data.hasOwnProperty('payload')){
data = data.payload;
}
deferred.resolve(data);
});
environment.json file
{
"payload": {
"environment": [
{
"environment": "Production"
},
{
"environment": "QA1"
},
{
"environment": "QA2"
}
]
}
}
data.datadata.datainconsole.log(data.data)if it really return the json