angular.js - How to get the length of the value of the form textarea in angularjs
为情所困
为情所困 2017-05-15 16:52:23
0
2
784

How does angularjs get the length of the value of the form textarea? I want to use the length of this length to determine whether another p is displayed

<p ng-show="">文字长度大于1显示,否则隐藏</p>
<textarea ng-model="test" placeholder="输入文字"></textarea>
为情所困
为情所困

reply all(2)
世界只因有你

You can judge the length directly through $scope.test拿到textareavalue,然后.length.

世界只因有你

ng-model has bound the value of textarea to the variable $scope.test, and directly determines the length of $scope.test

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template