<!DOCTYPE html>
<html lang="en" ng-app="start">
<head>
<meta charset="UTF-8">
<title>form</title>
<script type="text/javascript" src="js/angular.min.js"></script>
</head>
<body>
<form ng-submit="requestFunding()" ng-controller="StartUpController">
Starting:<input ng-change="computeNeeded()" ng-model="startingEstimate"/>
Recommendation:{{needed}}
<button>click!</button>
<button ng-click="reset()">reset</button>
</form>
<script type="text/javascript">
angular.module('start',[])
.controller('StartUpController',function($scope){
$scope.needed=0;
$scope.computeNeeded=function(){
$scope.needed = $scope.startingEstimate*10;
}
$scope.requestFunding = function(){
alert($scope.needed);
}
$scope.reset=function(){
$scope.startingEstimate = 0;
}
})
</script>
</body>
</html>