<!-- Plik: r02/ng-repeat-helper-variables.html -->
<html ng-app="notesApp">
<head>
  <meta charset="utf-8">
  <title>Notes App</title>
</head>
<body ng-controller="MainCtrl as ctrl">

  <div ng-repeat="note in ctrl.notes">
    <div>Pierwszy element: {{$first}}</div>
    <div>Środkowy element: {{$middle}}</div>
    <div>Ostatni element: {{$last}}</div>
    <div>Indeks elementu: {{$index}}</div>
    <div>Na pozycji parzystej: {{$even}}</div>
    <div>Na pozycji nieparzystej: {{$odd}}</div>

    <span class="label"> {{note.label}}</span>
    <span class="status" ng-bind="note.done"></span>
    <br/><br/>
  </div>

<script
  src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.js">
</script>
<script type="text/javascript">
  angular.module('notesApp', [])
    .controller('MainCtrl', [function() {
      var self = this;
      self.notes = [
        {id: 1, label: 'Pierwsza uwaga', done: false},
        {id: 2, label: 'Druga uwaga', done: false},
        {id: 3, label: 'Trzecia uwaga', done: true},
        {id: 4, label: 'Ostatnia uwaga', done: false}
      ];
    }]);
</script>
</body>
</html>
