<!doctype html>
<html lang='en' >
  <head>
    <title>Wielkość liter</title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.20/angular.min.js"></script>
  </head>

  <body ng-app='HomeModule' ng-controller="HomeController">
   <h1>{{pageHeading | titleCase}}</h1>

  <script>
    function HomeController($scope) {
      $scope.pageHeading = 'spójrz na doniosły tytuł tej strony';
    }

    var homeModule = angular.module('HomeModule', []);
    homeModule.filter('titleCase', function() {
      var titleCaseFilter = function(input) {
        var words = input.split(' ');
        for (var i = 0; i < words.length; i++) {
          words[i] = words[i].charAt(0).toUpperCase() + words[i].slice(1);
        }
        return words.join(' ');
      };
      return titleCaseFilter;
    });
  </script>
  </body>
</html>
