Is there a way to get the previous(last) value of a field on ngModelChange? What I have goes something like this
HTML
all you need to do is to put (ngModelChange)="textChanged($event)" to the left of [(ngModel)] element in the html tag, like:
This way, inside textChanged(event), the element you are binding to still has the previous value, while event is the new one
If you type
The event will be called with new value only. However:
-
Will get you both events with previous and current value