What is the Change trigger directive in Textarea?

Here is one version that I tried INSIDE TEXTAREA: (Change) = "DoSomething ($ event)"

and he does nothing. What is the directive for "change"?

+5
source share
1 answer

You must use ngModelChange

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

Live demo

Update:

(change) event will work in textarea, but it fires when blurred and the text is changed inside the text area

Demo

+13
source

Source: https://habr.com/ru/post/1267252/


All Articles