<pre lang="HTML"><div data-ng-app="myApp">
<div data-ng-controller="MyCtrl">
<form>
<table>
<tr style="font-weight: bold">
<td>ID</td>
<td>Name</td>
<td>Surname</td>
<td>House</td>
<td>Address</td>
<td>Locality</td>
<td>Contact</td>
<td>Contact 2</td>
<td>Contact 3</td>
<td>Reply</td>
<td>Edit</td>
</tr>
<tr data-ng-repeat="person in persons">
<td>{{person.ID}}</td>
<td>{{person.Name}}</td>
<td>{{person.Surname}}</td>
<td>{{person.House}}</td>
<td>{{person.Address}}</td>
</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript">
var myApp = angular.module('myApp', []);
myApp.controller('MyCtrl', ['$scope', '$http', function ($scope, $http) {
GetPersons();
$scope.DisplaySave = true;
function GetPersons() {
$http({
method: 'GET', url: '/api/data'
}).
success(function (data) {
if (data != null || data != 'undefined') {
$scope.persons = data;
$scope.newperson = {
Id: ''
};
}
})
.error(function (error) {
$scope.status = 'Unable to retrieve people' + error.message;
});
}
} ]);
</script>