Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular, typescript change detection input text [duplicate]

I can't find simple and easy solution how to detect change in my textfield. I dont want to use (keypress) because the user will sometimes paste values into the field. (onchange) for example is working only when user will blur field. And I want to detect change immediately.

What is the easiest angular js $watch equivalent?

like image 424
gkucmierz Avatar asked Mar 02 '17 18:03

gkucmierz


Video Answer


1 Answers

use ngModelChange

input id="form_name" [(ngModel)]="quantity" (ngModelChange)="calculateTotal($event)" 
like image 62
Sajeetharan Avatar answered Oct 14 '22 00:10

Sajeetharan