function TextareaCtrl($scope)
{
$scope.checkText = function () {
if ($scope.text.length > 5) {
alert("text is too long");
$scope.text = $scope.text.substr(0, 5);
}
};
}
You can do this:
Bind a variable ng-model="length" to the textarea to count your current word count, and then bind a variable through ng-disabled="length>=140" to make the textarea disabled, or a pop-up box or something, anyway It is to monitor the word count of the output box.
Use $watch
You can do this:
Bind a variable ng-model="length" to the textarea to count your current word count, and then bind a variable through ng-disabled="length>=140" to make the textarea disabled, or a pop-up box or something, anyway It is to monitor the word count of the output box.
<p ng-controller="myNoteCtrl">
</p>
<script>
</script>