【发布时间】:2017-11-01 13:10:06
【问题描述】:
我在琢磨如何访问具有动态名称的 JSON:
AngularJS http-get:
.then(function (response) {
$scope.GTMcontainersAccount = response.data;
console.log($scope.GTMcontainersAccount);
响应 JSON:
{
"Account2": [{
"accountId": "*******",
"containerId": "*******",
"name": "Container23"
}, {
"accountId": "*******",
"containerId": "*******",
"name": "Container2"
}],
"Account 1": [{
"accountId": "*******",
"containerId": "*******",
"name": "Container1"
}]
}
我的目标是在表格中使用 ng-repeat 来显示如下:
AccountName | AccountId | containerId | name
Account2 | ******* | ******* | Container23
Account2 | ******* | ******* | Container2
Account1 | ******* | ******* | Container1
如何使用控制器输出类似这个表格的东西?
【问题讨论】:
标签: javascript angularjs json angularjs-ng-repeat