The $apply
function can run on any scope, including $rootScope
.
Are there cases when it makes a difference if I run it on my local scope or
Running $apply
on any scope always results in a $rootscope.$digest
. The only case where it might make a difference is when you provide an expression as an argument to $apply
. The expression will be evaluated in the current scope (vs. $rootScope), but afterwards $rootscope.$digest
is always called.
The source code is quite clear: rootScope.js
Bottom line:
If you call $apply
with no arguments, it makes no difference.