Can I prevent / delay the AngularJS $digest from happening when model is updated

前端 未结 1 1906
太阳男子
太阳男子 2020-12-20 12:25

Is there a way to postpone or delay a digest from happening?

I have a bunch of changes that I want to make to a model but I don\'t want the digest to fire until al

相关标签:
1条回答
  • 2020-12-20 12:33

    This is not a hack at all. Its a good question because large data sets can cause the $digest cycle to run very slowly when a user inputs text rapidly or holds down backspace. You can definitely do performance tweaks like being careful with your $watch and $filter functions, but sometimes its a better idea to delay the $digest cycle using a debounce function.

    0 讨论(0)
提交回复
热议问题