// Plik: r05/need-for-service/app.js
angular.module('notesApp', [])
  .controller('MainCtrl', [function() {
    var self = this;
    self.tab = 'first';
    self.open = function(tab) {
      self.tab = tab;
    };
  }])
  .controller('SubCtrl', [function() {
    var self = this;
    self.list = [
      {id: 1, label: 'Element 0'},
      {id: 2, label: 'Element 1'}
    ];

    self.add = function() {
      self.list.push({
        id: self.list.length + 1,
        label: 'Element ' + self.list.length
      });
    };
  }]);
