How to stop digest cycle manually in angularjs

后端 未结 3 2054
盖世英雄少女心
盖世英雄少女心 2020-12-29 07:17

As digest cycle do the dirty checking of the variable that is if there are 100 scope variables and if I change one variable then it will run watch of all the variables.

3条回答
  •  感动是毒
    2020-12-29 07:56

    This is quite a specific use-case to do exclusive/conditional checks in the digest cycle and I don't think it is possible without forking/hacking the angular core.

    I would consider refactoring how/what you are $watching. Perhaps using ngModelController's $viewChangeListeners would be more suitable than $watch?

提交回复
热议问题