Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Change scope.$apply to scope.$digest #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rodrigolourenco
Copy link

Reading about $apply and $digest on angular communitty, i found that the use of these method's and the impact of launching them concurrently. For example, on my code/test's i launch digest to check the carousel change, but when i do this angular give me an error like this: "https://docs.angularjs.org/error/$rootScope/inprog?p0=$digest". So i change the code to trigger a $digest cycle, not a $apply after read this article "http://www.benlesh.com/2013/08/angularjs-watch-digest-and-apply-oh-my.html". In the case of the carousel, the $apply just have to change the carousel itself and not the entire view, because of this, than i change to $digest.

Simply put, it's a wrapper around $rootScope.$digest that evaluates any expression passed to it prior to calling $digest(). That's it. So, if you're calling it by itself without passing an argument to it, you may as well just call $digest().

Thank u !
Best regards from Brasil

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant