Angularjs 计算输入字段中的值

Angularjs 计算输入字段中的值,angularjs,Angularjs,我正在尝试创建一个带有两个按钮的输入字段,这将使输入字段中的数字增加1,并使其分心 一切正常,但当我试图直接在输入字段中更改数字时,按钮停止工作 函数Ctrl($scope){ $scope.Score1=0; $scope.$watch('Score1',函数(newVal){ $scope.Score1=newVal; console.log(newVal); }); $scope.add_btn=函数(){ $scope.Score1++; }; $scope.dist_btn=函数()

我正在尝试创建一个带有两个按钮的输入字段,这将使输入字段中的数字增加1,并使其分心

一切正常,但当我试图直接在输入字段中更改数字时,按钮停止工作

函数Ctrl($scope){
$scope.Score1=0;
$scope.$watch('Score1',函数(newVal){
$scope.Score1=newVal;
console.log(newVal);
});
$scope.add_btn=函数(){
$scope.Score1++;
};
$scope.dist_btn=函数(){
如果($scope.Score1>0){
$scope.Score1--;
}否则{
$scope.Score1=0;
}
};
}


+
-
用于绑定输入():


<input type="text" ng-model="Score1">