How to write a debounce service in AngularJS

前端 未结 7 666
说谎
说谎 2020-11-27 11:01

The underscore library provides a debounce function that prevents multiple calls to a function within a set period of time. Their version makes use of setTimeout.

H

相关标签:
7条回答
  • 2020-11-27 12:01

    There is a good implementation of both a debounce service and directive that can work with any ng-model at: https://github.com/shahata/angular-debounce

    Or simply install it using:

    bower install ng-debounce
    
    0 讨论(0)
提交回复
热议问题