I am trying to understand exactly how the digest is working and what is the best practice when you need to update angular with model change.
i am using websockets in order to communicate with the server, so i have to make sure a digest is being called each time i get a message from the server.
1. I use $apply most of the times, or $timeout with 0 as wait ms. , but i see examples that call the scope.$digest specifically (for example in the ng-grid project code). so what is the best practice and what is the differences?
2. If i am calling the scope.$digest manually does it fire the dirty checking for all watchers or only the scope children watchers? in angular code i see that digest is changing the $$phase of the rootscope, but it wasnt clear to me which watchers are being checked.
3. Is there any special effect that happens when there is an apply call/digest inside a directive with isolated scope?
Thanks