angularjs text area character counter

后端 未结 4 1993
无人及你
无人及你 2020-12-03 00:51

Hi I have a characeter counter for a text area. My problem is that it doesn\'t count spaces or linebreaks. How do I make it so that it does so?

   
4条回答
  •  孤城傲影
    2020-12-03 01:13

    you can use a function with call ng-change=""

           

    {{1500-chrLength}} Characters

    and in controller.js

    $scope.countLength = function(val){
      $scope.chrLength = val;
    }
    

提交回复
热议问题