Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am developing an application that needs to show the data returned in JSON format in a HTML table. My following code is capable of retrieving JSON data.

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);
                });
            });
        });
    };
}
share|improve this question
2  
@MaxMommersteeg: your edit is invalid, it decreases readability, so I've reverted it. Don't ever vandalize posts like this. –  user529758 Dec 23 '13 at 9:53
 
thanks @MaxMommersteeg ... i was in a hurry for getting the answer. and mistyped it –  Om Shanker Dec 23 '13 at 9:56
 
@H2CO3 Sorry, didn't notice my edit was set in queue, but it was way better than post at begin. –  Max Mommersteeg Dec 23 '13 at 9:58
add comment

1 Answer

You can use angularTable and pass your JSON as the angularTable model via the $scope.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.