<!-- ng-repeat sport i igraci.gradovi je hardkodovan, treba filter uniq -->
<!DOCTYPE html>
<html>

    <head lang="en">
        <meta charset="utf-8">
        <title>Multi igraci</title>
        <script src="../libs/angular-1.4.0/angular.min.js"></script>
        <script src="app.js"></script>
    </head>

    <body ng-app="myApp">

        <div ng-controller="IgraciKontrol as igraci">

            <form>
                <label>Traži:
                    <input ng-model="igraci.trazeno">
                </label><br/><br/>

                <label>Po sportu:
                    <select ng-model="igraci.kriteriji.sport">
                        <option></option>
                        <option ng-repeat="sport in ['kosarka', 'hokej', 'fudbal']">{{sport}}</option>
                    </select>
                </label><br/><br/>

                <label>Po gradu:
                    <select ng-model="igraci.kriteriji.grad">
                        <option></option>
                        <option ng-repeat="grad in igraci.gradovi">{{grad}}</option>
                    </select>
                </label><br/><br/>

                <label>Istaknuti:
                    <input ng-false-value="''" ng-model="igraci.kriteriji.istaknut" type="checkbox"/>
                </label><br/><br/>
            </form>

            <table>
                <thead>
                    <tr>
                        <th>Ime</th>
                        <th>Sport</th>
                        <th>Grad</th>
                        <th>Istaknut</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="team in igraci.spisak | filter:igraci.kriteriji | filter:igraci.trazeno">
                        <td>{{team.ime}}</td>
                        <td>{{team.sport}}</td>
                        <td>{{team.grad}}</td>
                        <td>{{team.istaknut}}</td>
                    </tr>
                </tbody>
            </table>

        </div>

    </body>
</html>
