【发布时间】:2014-04-06 05:11:05
【问题描述】:
如何使用 AngularJS ng-repeat 迭代这个 JSON 值?
{
"timestamp": "Wed Apr 02 2014, 19:03:19",
"test": [
441.02,
null,
null,
460.99,
485.91,
501,
null,
null,
null,
null
],
"test1": [
437,
null,
null,
464.989,
488.52,
499.996,
null,
null,
null,
null
],
"test3": [
10.85,
null,
null,
10.9,
10.9,
10.9,
null,
null,
null,
null
]
}
这是我正在使用的控制器:
var myJson = angular.module('myJson', []);
function PostsCtrlAjax($scope, $http)
{
$http({method: 'POST', url: 'graphs.json'}).success(function(data)
{
$scope.values = data; // response data
});
}
我想在一些 html 引导表中显示 test/1/2/3 中的所有值。
另外,我如何使用 JavaScript 将所有这些值存储在某个数组 [] 中? 提前致谢!
【问题讨论】:
-
能否请您给出您想要的大致布局。