我正在开发一个需要在HTML表格中显示以JSON格式返回的数据的应用程序。我的以下代码能够检索JSON数据。
function bincontroller($scope, $http, $templateCache) {
$scope.updateModel = function () {
$http({
url: "/abc/abc/ss/ds/",
method: "GET",
params: {
data: {
"markingPeriod": 8,
"syear": 2013,
"teacherId": "",
"startDate": "2013-11-25",
"endDate": "2013-12-26"
},
r: "api/v1/Attendance/Bin"
}
}).success(function (data) {
data = angular.fromJson(data);
angular.forEach(data.collection.response, function (value, index) {
angular.forEach(value, function (val, ky) {
console.log(ky + " : " + val);
});
});
});
};
}