Emitting a message in sails v0.11 (client-side)
问题 I'm having some issues with the newest version of sails.js (0.11.0). It stated in github that plain socket.io code will be accepted and ran in sails.js; however, I am simply trying to emit a message from a client when they click on something like so: $('#myBtn').on('click', function(){ io.socket.emit('message', { message: { subject: subject }, sender: id }); }); I end up getting an "Uncaught TypeError: undefined is not a function" on the line of io.socket.emit() aka emit is not a function of