angular / ngSocket

WebSocket support for angular
Apache License 2.0
204 stars 25 forks source link

TypeError: Cannot read property 'connect' of undefined #38

Closed janmichaelyu closed 7 years ago

janmichaelyu commented 7 years ago

Hi, I'm receiving

TypeError: Cannot read property 'connect' of undefined at socketFactory (http://localhost:3000/bower_components/angular-socket-io/socket.js:31:44)

by calling: socket.emit('client', newValue);

I have 'btford.socket-io' on my dependencies and added: .factory('socket', function (socketFactory) { var mySocket = socketFactory(); mySocket.forward('server'); return mySocket; });

and on my controller I injected 'socket'

What am I missing?

janmichaelyu commented 7 years ago

/facepalm, opened this on the wrong project.