Ionic text area input event
I am using Ionic3 and have:
<ion-textarea (change)="reviewChange()"></ion-textarea>
When the user changes input and blurs the focus out of the text area, the function is reviewChange()
triggered as expected.
Question
Is it possible to add an event equivalent ion-searchbar
ionInput
? that is, when the user enters text, an event is fired for each key pressed.
Background
I am trying to track how many characters a user has left. eg.
500 characters left
To do this, I need to track every key stroke. Is there a better way or some automated way to do this?
source to share
An easier way would be to bind the text area to a property from the component
<ion-textarea maxlength="500" [(ngModel)]="myText"></ion-textarea>
And below that area of ββtext, you can display the characters remaining like this:
<span>{{ 500 - myText.length }} characters left</span>
source to share