Hi Hennadii,

There are no hard rules for this. However, you only need $apply when you 
are dealing with outside events.
like web-socket messages coming in, JQ plugins updating data, non-angular 
time-out's, and so on.
All those things should be handled in directives, or services. Not in a 
normal controller. (a controller inside a directive may be ok...)
For myself I follow the rule that if the event originates from the DOM its 
handled in a directive.
If it comes from elsewhere (mostly the network, but it can be a web-worker 
too!) it's handled in a service.

Regards
Sander


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to