JSFiddle - React, Tailwind, and code Playground
by Tom Vertongen
HTML
<div ng-app="agenda" ng-controller="AgendaListCtrl">
<p>Filter monitor 1: {{(opl|filter:query).length}} / {{opl.length}}</p>
<p>Filter monitor 2: {{(opl|filter:Type).length}} / {{opl.length}}</p>Search:
<input ng-model="query">Sort by:
<select ng-model="orderProp">
<option value="Titre_NL">Alphabetical</option>
<option value="NoEDA">Newest</option>
</select>
<ul>
<li ng-repeat="opl in opleidingen | filter:query | orderBy:orderProp | filter:Type">{{opl.NoEDA}}
<p><a href="{{opl.Titel}}" />{{opl.Titre_NL}}/></a>
</p>
</li>
</ul>
</div>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
JavaScript
var agenda = angular.module('agenda', []);
myapp.controller('AgendaListCtrl', ['$scope', function ($scope) {
// Normally a json file with more records...
$scope.opl = [{
"id": "1",
"NoEDA": "439",
"Titre": "http://www.link.com",
"Titel": "http://www.link.com",
"Titre_FR": "titre",
"Titre_NL": "titel",
"Departement": "Department 1",
"Type": "Type B",
"Duration": "16",
"Target": "TargetC, TargetB1, TargetB2, TargetB4",
"Min": "15",
"Max": "18",
"Key": "true",
"Place": "Place 1, Place 2, Place A, Place C, Place 10, Place T"
}, {
"id": "2",
"NoEDA": "910",
"Titre": "http://police.ac.be/download/fiches/da910.pdf",
"Titel": "http://police.ac.be/download/fiches/ed910.pdf",
"Titre_FR": "Personne de confiance",
"Titre_NL": "Vertouwenspersoon",
"Departement": "Department 2",
"Type": "Type A",
"Duration": "32",
"Target": "TargetA1, TargetA2, TargetB",
"Min": "16",
"Max": "20",
"Key": "true",
"Place": "Place 1B"
}];
}]);