It seems as if angularjs is adding a field to my model, but I can't figure out why and how to prevent this. Any help would be appreciated!
services.js
factory('Logs', function($resource) {
return $resource('/api/logs/:ident',{}, {
get: {method:'GET', isArray: true}
});
});
controller.js
Logs.get({ ident: $scope.selected_log },
function(data) { // success
console.log(data) // result is logged - see next code blog
$scope.log_data = data;
},
function(data) { // failure
console.log('failure - could not get the device logs')
})
}
Result in angular
[
{ "x":1362045352,
"y":"100",
"y0":0 },
{ "x":1362045536,
"y":"100",
"y0":0 }, ...
]
Result using curl on the commandline
[
{ x: 1362045352,
y: "100" },
{ x: 1362045536,
y: "100" }, ...