如何使用angular从json提取值?
问题描述:
如何从json [{"status":57}]中提取57?
How do i extract 57 from this json [{"status":57}] in angular?
我尝试了JSON.parse('{"status":57}').status,但会产生错误.
I have tried JSON.parse('{"status":57}').status but produces an error.
答
[{状态":57}]已经是对象的数组/数组
[{"status":57}] is already an array / array of object
您只需要提取值
data = [{"status":57}];
data[0].status