AngularJS directive for validating form fields only after user has stopped typing.
1 person uses it
Author: 3641ca23c64b89e6b15eb25c54568146? calendee


val-on-timeout improves the user experience for forms. When the user has stopped activity in a field, validation errors will be displayed.


  • Configurable timeout after pause in typing
  • Configurable timeout on focus
  • Configurable timeout on blur


Simply include as a dependency in your module.


Detect When User Stops Typing

NOTE : The default timeout for typing is 1250ms.

Detect When User Stops Typing With Custom Timeout Limit

Detect When Field Has Had Focus For Too Long

If a user focuses on a field but fails to begin typing, the timeout can be detected. The default focus timeout is 5000ms. It can be configured by providing any value with the attribute.

Detect When Field Blurred

If a field loses focus, you can apply the timeout to display errors. The default focus timeout is 500ms. It can be configured by providing any value with the attribute.


To run a demo, start a local Python server from the repository's root directory :

Then, go to : http://localhost:3001/example/


From the project root directory, run karma start.


Justin Noel


Thanks to Ari Lerner (@auser) for the inspiration for this directive. His ngFocus directive lead the way.

I whined about my complaints with Angular JS validation to Sharon DiOrio (@sharondio) while at #ng-conf. She didn't take pity and suggested I do something about it. Thanks for the push.


val-on-timeout is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.

comments powered by Disqus
This page was last updated over 4 years ago.