<!doctype html>
<html ng-app>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.20/angular.min.js"></script>
  </head>
  <body>
    <form ng-submit="requestFunding()" ng-controller="StartUpController">
      Kwota minimalna: <input ng-change="computeNeeded()" ng-model="funding.startingEstimate">
      Kwota zalecana: {{funding.needed}}
      <button>Finansuj mój start-up!</button>
    </form>
    <script>
      function StartUpController($scope) {
        $scope.funding = { startingEstimate: 0 };
        $scope.computeNeeded = function() {
          $scope.funding.needed = $scope.funding.startingEstimate * 10;
        };

        $scope.requestFunding = function() {
          window.alert("Przepraszamy, ale najpierw musisz pozyskać większą liczbę klientów.");
        };
      }
    </script>
  </body>
</html>
