You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gives Error: SignalR: Connection must be started before data can be sent. Call .start() before .send(). I'm struggling how to incorporate the hub.promise.done in the code above to execute only when the hub has connected. I tried several approaches with no luck..
Thanks!
The text was updated successfully, but these errors were encountered:
Another possibility is adding a variable to your factory as an indicator if the hub is ready.
Make this a boolean eg
varhubReady=false;
In the hub.promise.done you set this variable to true.
And in your function getCurrentActuals you first check for the value of hubReady. If the hub is not ready, you handle that gracefully. If it's ready, you call the hub method.
If you expose the hubReady variable to the controller, you could add a watch on the variable. So that as soon as the hubReady variable changes to true, your console.log will fire.
You could also do a broadcast in the hub.promise.done and catch that broadcast in your controller.
I'm struggling with the factory and the async nature of it as a AngularJS newbie, unfortunately the provided chat app does not handle my problem:
Gives Error: SignalR: Connection must be started before data can be sent. Call .start() before .send(). I'm struggling how to incorporate the hub.promise.done in the code above to execute only when the hub has connected. I tried several approaches with no luck..
Thanks!
The text was updated successfully, but these errors were encountered: