janpantel / angular-sails

An angular module for using the sails socket.io api
MIT License
307 stars 56 forks source link

AutoConnect off #64

Closed juanpasolano closed 9 years ago

juanpasolano commented 9 years ago

I don't know If this module auto-connects but I am using the io.sails.autoConnect = false and I think the angular-sails module is still trying to connect. Is there a setting to prevent this? I look at the $sailsProvider but there is nothing there I think that sets this behaviour.

TheSharpieOne commented 9 years ago

angular-sails will also disable auto connect. Its set to connect when you invoke/inject $sails since angular lazy loads the services. This means that this will not get called until you need it. This prevents angular-sails from trying to use a socket that is not connected or having to check if the socket is connected everywhere its called. This cannot be overridden. If you want to hold off connecting, do not inject $sails until you want the connect to be established.

TheSharpieOne commented 9 years ago

Closing issue due to inactivity. Please feel free to comment if the issue is not resolved.