How to write a debounce service in AngularJS

前端 未结 7 711
说谎
说谎 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 11:46

    Support for this has landed in angularjs#1.3.0.beta6 if you're dealing with a model interaction.

    https://docs.angularjs.org/api/ng/directive/ngModelOptions

提交回复
热议问题