I'm using this angular code:
$http({
method: 'get',
url: 'json/test.json',
responseType: "json"
}).success(function(data, status, headers, config) {
console.log('Success: ' + data);
$scope.tests = data;
}).error(function(data, status, headers, config) {
console.log('Error: ' + data);
});
the response is like this:
[{
id: 1,
name: 'aaaa',
age: 20
}, {
id: 2,
name: 'bbbbb',
age: 21
}]
In the console, it prints:
Success: null
how come it returns success, but data is null.
any help appreciated!