<!-- Plik: r02/controller-click-message.html -->
<html ng-app="notesApp">
<head>
  <meta charset="utf-8">
  <title>Notes App</title>
</head>
<body ng-controller="MainCtrl as ctrl">
  {{ctrl.message}} AngularJS.

  <button ng-click="ctrl.changeMessage()">
    Zmień napis
  </button>
<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.message= 'Witaj, ';
      self.changeMessage = function() {
        self.message = 'Żegnaj';
      };
  }]);
</script>
</body>
</html>
