如何在angularjs中获得这些数据的价值

时间:2015-03-20 11:08:47

标签: angularjs angularjs-scope

{
  "code": 2001,
  "message": "todays usage",
  "results": [
    {
      "date": "2015-03-20",
      "download": 7.063141,
      "mac": "18f46ab79f0d",
      "upload": 16.086909
    }
  ],
  "status": 200
}

如何从这个json对象获取下载值?我想获得下载的值并上传。

1 个答案:

答案 0 :(得分:0)

示例:如果将上述json分配给名为jsonObject的变量:

var downloadValue = jsonObject.results[0].download;
var uploadValue = jsonObject.results[0].upload;