What is the Angular4 "Change" event trigger directive in Textarea

Pano picture Pano · Apr 27, 2017 · Viewed 42.5k times · Source

Here is one of the versions that I tried INSIDE TEXTAREA: (change)="dosomething($event)"

and it's not doing anything. What is the directive for "change"?

Answer

Aravind picture Aravind · Apr 27, 2017

You should be using ngModelChange

   <textarea cols="25" [ngModel]="data" (ngModelChange)="doSomething($event)"></textarea>

LIVE DEMO

Update:

(change) event will work in textarea but it is triggered on blur and text changed inside the text area

DEMO