btford/angular-socket-io

how can i confirm the angular app is successful connected ?

Opened this issue · 1 comments

how to confirm the angular app is successful connected to some ip address ? please give some example code. thanks!

AzRu commented

if you log the socket object, it has 'disconnected' and 'connected' fields

so how about something like

var socket = io.connect(YOUR_URL);
if (socket.connected) console.log('connected!');