<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Filteri hoteli</title>
    <script src="../libs/angular-1.2.29/angular.min.js"></script>
    <script src="app.js"></script>
</head>

<body ng-app="App">

    <div ng-controller="HoteliKontrol as hoteli">
        <p>Pretrazi hotele: </p>
        <label>
            <input type="checkbox" ng-model='hoteli.kriteriji.skupoca' ng-true-value='skup' ng-false-value='' /> Skupi
        </label>
        <label>
            <input type="checkbox" ng-model='hoteli.kriteriji.jeftinoca' ng-true-value='jeftin' ng-false-value='' /> Jeftini
        </label>
        <label>
            <input type="checkbox" ng-model='hoteli.kriteriji.dostupnost' ng-true-value=true ng-false-value='' /> Slobodni
        </label>
        <br/>
        <br/>

        <table>
            <tr>
                <th>Ime</th>
                <th>Ocena</th>
                <th>Vrsta</th>
                <th>Cena</th>
                <th>Slobodno</th>
            </tr>
            <tr ng-repeat="hotel in hoteli.spisak | filter:{ vrsta: hoteli.kriteriji.skupoca } | filter:{ vrsta: hoteli.kriteriji.jeftinoca } | filter:{ slobodan: hoteli.kriteriji.dostupnost } ">
                <td>{{hotel.ime}}</td>
                <td>{{hotel.ocena}}</td>
                <td>{{hotel.vrsta}}</td>
                <td>{{hotel.cena}}</td>
                <td>{{hotel.slobodan ? "slobodno" : "zauzeto"}} </td>
            </tr>
        </table>
    </div>

</body>
</html>
