sample.html
<input #gb type="text" pInputText class="ui-widget ui-text" [(ngModel)]
="filterText" (ngModelChange)="filterText = $event; clearFilter(filterText)"/>
componenent.ts
clearFilter(value) {
alert(value);// values is empty
}
This alert will be fire every focus (in | out) on the input filed . I want to do hit the function if the model object had any changes.
How to handle it and Why
ngModelChangeevent triggering while focus in and out on the input box?