改变数据,视图不刷新的情况下,请加上$scope.$apply();
$scope.$apply(function() { var leftNewVal = (left / 0.5 + (mouseMoveX - mouseDownX) / 0.5); var topNewVal = (top / 0.5 + (mouseMoveY - mouseDownY) / 0.5); $scope.templatePosition.index[curKeyName].left = leftNewVal; $scope.templatePosition.index[curKeyName].top = topNewVal; }) $scope.$watch('templatePosition',function(obj){ $scope.progressStyle($scope .templatePosition); }, true);