In this article I will explain with an example, how to populate HTML Table from external API using AngularJS.
The HTML Table will be populated from a JSON array using AngularJS.
ASPSnippets Test API
The following API will be used in this article.
The API returns the following JSON.
      "Name":"John Hammond",
      "Country":"United States"
      "Name":"Mudassar Khan",
      "Name":"Suzanne Mathews",
      "Name":"Robert Schidner",
Populating HTML Table from API using AngularJS
The following HTML Markup consists of an HTML DIV to which ng-app and ng-controller AngularJS directives have been assigned.
Note: If you want to learn more about these directives, please refer my article Introduction to AngularJS.
The HTML DIV consists of an HTML Table which will be populated from JSON array using ng-repeat directive.
Inside the Controller, the API is called using the $http service. The $http service has following properties and methods.
1. method – The method type of HTTP Request i.e. GET or POST.
2. url – URL of the API.
Event Handler
1. success – This event handler is triggered once the call is successfully executed.
2. error – This event handler is triggered when the call encounters an error.
Inside the Success event handler of the $http service the response is received in JSON format and assigned to the Customers variable.
The ng-repeat directive as the name suggests repeats the element based on the length of the collection, in this scenario it will repeat the TR element (HTML Table Row).
The TBODY element of the HTML Table has been assigned ng-repeat directive in order to iterate through all the items of the Customers JSON array.
Finally, for each JSON object in the Customers JSON array, a TR element (HTML Table Row) is generated and appended into the HTML Table.
<div ng-app="MyApp" ng-controller="MyController">
    <table cellpadding="0" cellspacing="0">
        <tbody ng-repeat="m in Customers">
<script type="text/javascript" src=""></script>
<script type="text/javascript">
    var app = angular.module('MyApp', [])
    app.controller('MyController', function ($scope, $http, $window) {
        var get = $http({
            method: "GET",
            url: ""
        get.success(function (data, status) {
            $scope.Customers = data;
        get.error(function (data, status) {
Populate Table from API using AngularJS
Browser Compatibility

The above code has been tested in the following browsers.

Internet Explorer  FireFox  Chrome  Safari  Opera 

* All browser logos displayed above are property of their respective owners.