<html ng-app>
<body>
<form ng-controller="StartUpController">
Starting:
<input ng-change="computeNeeded()"
ng-model="funding.startingEstimate">
Recommendation: {{funding.needed}}
</form>
<script src="angular.min.js"></script>
<script>
function StartUpController($scope) {
$scope.funding = { startingEstimate: 0 };
$scope.computeNeeded = function () {
$scope.needed = $scope.startingEstimate * 10;
};
}
</script>
</body>
</html>
输出是在文本框中输入的值的十倍......但没有收到任何输出。