Skip to content

Nothing happens with the on method #4

@Hamashi

Description

@Hamashi

Hello, I would like to use sails.io.js with angular5, so I used angular2-sails module. I managed to connect angular to sails BUT I didn't manage to retrieve the events from sails.js, for example when a new document is created in database. Is there something to configure sails side ? I used this.sailsService.on("user").subscribe(data => console.log("event on user")). The get and post methods are perfectly working. Sails side I put

 ioclient:  require('socket.io-client')('http://localhost:1337'),
io: require('sails.io.js'),

In config/http.js, instead of
var io = require('sails.io.js')( require('socket.io-client') );

because sails cannot load else
I didn't write anything in config/socket.js

Did I make something wrong so I can't get the event ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions