janpantel / angular-sails

An angular module for using the sails socket.io api
MIT License
307 stars 56 forks source link

socket.on isn't responding #92

Closed berendberendsen closed 8 years ago

berendberendsen commented 8 years ago

I can't seem to get the socket.on to work with sails running as a separate back-end. I am running sails 0.11.4 and the .get calls are working fine, but .on doesn't seem to be doing anything. Any hints or tips are more than welcome.

Front-end code:

//this works fine     
 $sails.get('/order', function(message){
     console.log(message);
      });
//this doesn't do anything
      var orderHandler = $sails.on("order", function(message) {
        console.log(message);
      });

Backend config:

berendberendsen commented 8 years ago

Never mind, the error was caused by the person sitting in front of the computer. I wasn't using blueprint routes.