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
When I require=('socket.io') in node, there is a error on the console, dispite I have the socket.io.js file included on my HTML
socket.io.js:12 Uncaught ReferenceError: require is not defined
at socket.io.js:12
Here is my controller code:
// 'use strict';
// in the top-level module of the app
angular.module('Outlook', [
'btford.socket-io',
'Outlook.MyCtrl'
]).
factory('mySocket', function (socketFactory) {
return socketFactory();
}).
controller('Outlook', function (mySocket) {
// ...
}).factory('socket', function ($rootScope) {
var socket = io.connect();
return {
on: function (eventName, callback) {
socket.on(eventName, function () {
var args = arguments;
$rootScope.$apply(function () {
callback.apply(socket, args);
});
});
},
};
});
I have used socket.io without any libraries before, but not in a MEAN stack way. I am certain I am missing something, but I'm not quite sure. Can you help with a hello world example? Thank you,
Jorge
The text was updated successfully, but these errors were encountered:
I tried to kickstart the express-> angular code with https://www.npmjs.com/package/angular-socket-io
but the step
When I require=('socket.io') in node, there is a error on the console, dispite I have the socket.io.js file included on my HTML
Here is my controller code:
I have used socket.io without any libraries before, but not in a MEAN stack way. I am certain I am missing something, but I'm not quite sure. Can you help with a hello world example? Thank you,
Jorge
The text was updated successfully, but these errors were encountered: