I have a text field with ng-change event.Event should be called only when the user completed typing.How to delay calling the event?
<input type="text" ng-model="custname" ng-change="findCustName()">
I have a text field with ng-change event.Event should be called only when the user completed typing.How to delay calling the event?
<input type="text" ng-model="custname" ng-change="findCustName()">
On
When I want to call a function when typing is completed I use ng-keyup.
Using ng-keyup your function will be call every time user press a key.
I know your asking when user finish typing , but let me explain why I prefer using ng-keyup and not ng-blur
If I have to call a validation function, ng-blur won't help, because you will have to focus out to launch the function. Using ng-keydown, function will be launch. so if user finished typing it will be launch also
You should use
ng-blurinsteadIf you do not want to use ng-blur or lost focus, you can use the same ng-change with
ng-model-optionsAs of Angular 1.3, you could use Angular ng-model-options directive