Closed iloverails closed 9 years ago
You can access the actual socket connection through $sails._raw
. From there you can get to the emit
method via $sails._raw.emit
.
To use emit
you must pass it an endpoint/url, request data, and a callback like this:
$sails._raw.emit('/api/endpoint', {
something: 'anything
}, function(response){
console.log(response);
});
Hi, can you answer please how can I use emit events?