can't find io.connect?!
I was trying to intergrate socket.io with meanjs following by this article: https://vexxhost.com/resources/tutorials/mean-socket-io-integration-tutorial/
I got io is not defined error on file 'public\modules\articles\services\socket.client.service.js'
'use strict';
//socket factory that provides the socket service
angular.module('core').factory('Socket', ['socketFactory',
function(socketFactory) {
return socketFactory({
prefix: '',
ioSocket: io.connect('http://localhost:3000')
});
}
]);
you need to load socket.io before you try to use it in angular
i'm seeing this error also. i'm not sure what you mean @shawn-simon. shouldn't dependency injection take care of this or are you saying we need to also add another dependency to the angular app aside from btford.socket-io?
i think you mean we need to load socket.io-client, before we load this library but there isn't a bower component so you need to use overrides if you bower install this package. https://github.com/socketio/socket.io-client
i think the README should be explicit about this dependency.
i think the README should be explicit about this dependency.
PR welcome
Will send along when I get a chance to. Thanks!
On Sun, Sep 27, 2015, 4:23 AM Brian Ford [email protected] wrote:
i think the README should be explicit about this dependency.
PR welcome
— Reply to this email directly or view it on GitHub https://github.com/btford/angular-socket-io/issues/118#issuecomment-143528652 .