How do i extract 57 from this json [{"status":57}] in angular?
I have tried JSON.parse('{"status":57}').status but produces an error.
How do i extract 57 from this json [{"status":57}] in angular?
I have tried JSON.parse('{"status":57}').status but produces an error.
[{"status":57}] is already an array / array of object
you just need to extract the value
data = [{"status":57}];
data[0].status
Use angular.fromJson to deserialize JSON strings:
angular.fromJson([{"status":57}])[0].status;