formations/javascript/angular/exercices/filtres-1/.solution/index.html
2019-03-25 13:14:16 +01:00

47 lines
1.1 KiB
HTML

<html>
<head>
<meta charset="utf8">
<title>Exercice: Utilisation des filtres</title>
</head>
<!-- Déclaration de l'application -->
<body ng-app="Exo">
<div ng-controller="MainCtrl">
<h1>Commits du dépôt torvalds/linux sur Github</h1>
<table>
<thead>
<tr>
<th colspan="4">
<input type="text" style="width: 100%" placeholder="Filtrer la liste" ng-model="search" />
</th>
<tr>
<tr>
<th>Date</th>
<th>SHA</th>
<th>Author</th>
<th>Message</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="c in commits | filter:search">
<td>{{c.commit.author.date | date:'dd-mm-yyyy' }}</td>
<td>{{c.sha | limitTo:10 }}</td>
<td>{{c.commit.author.name }}</td>
<td ng-bind-html="c.commit.message | highlight:search"></td>
</tr>
</tbody>
</table>
</div>
<!-- Import de du framework Angular -->
<script src="../../node_modules/angular/angular.js"></script>
<script src="app.js"></script>
</body>
</html>