Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope $digest() not triggered after hub events fired #21

Open
ProdigySim opened this issue Nov 20, 2014 · 0 comments
Open

Scope $digest() not triggered after hub events fired #21

ProdigySim opened this issue Nov 20, 2014 · 0 comments

Comments

@ProdigySim
Copy link

In order for angular to update our UI magically, we need $rootScope.$digest() to occur after any of our app code is executed. When angular-signalr-hub receives an incoming event from the hub, it does not trigger a digest afterwards--so any data changes we make in our event listeners will not be automatically picked up by angular.

This can be solved by either manually calling $rootScope.$apply() or $rootScope.$digest() after running the user's event callbacks (à la $TimeoutProvider) or by simply wrapping the callbacks in a $timeout() call (See: angular-socket-io).

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

No branches or pull requests

1 participant