1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| <!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js">
</script>
</head>
<body>
<div ng-app="monApplication" ng-controller="monControleur">
<br>
{{comptes}}
<br>
<table border="1" align="left">
<tr>
<th>Compte</th>
<th>Libellé</th>
</tr>
<tr ng-repeat="compte in comptes">
<td>{{compte.numero}}</td>
<td>{{compte.libelle}}</td>
</tr>
</table>
</div>
<script>
var application = angular.module("monApplication", []);
application.controller("monControleur", function($scope, $http) {
$http.get("http://127.0.0.1:8080/compte/comptes")
.then(function (response) {
$scope.comptes = response.data.comptes
});
});
</script>
</body>
</html> |
Partager