Currently, I am incorporating AngularJS into a new project and faced with the task of counting the length of a textarea. Adding up the total number of "pages" in the messaging app every 160 characters while decreasing if text is removed.
Obtaining the length of the textarea using Angular is straightforward:
<textarea ng-model="message" class="form-control" name="message" id="message" cols="30" rows="2"></textarea>
<span class="help-block"><strong>Characters</strong>: <% message.length > 0 ? message.length : 0 %></span>
I believe that handling the logic to figure out the number of pages should be done in my Javascript code, but I'm struggling to connect the ng-model
to my script. Any guidance on this matter would be greatly appreciated.