-
-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add element from server ? #129
Comments
You have to use app.service like setInterval(function () {
var service = app.service('todos');
service.create({
text: 'Hi!',
complete: false
}, {}, function(error, todo) {
console.log('Created todo on server', todo);
});;
}, 1000); |
Thank you for your answer, But this does not emits message via the socket to the browser ... I have to reload the page to see the new created by the server |
How does your client look like? Are you listening to |
this is the client example on feathersjs.com :
|
I tried on chrome and safari |
I just tried by downloading the Gist for the example, extracting, in the folder running setInterval(function () {
var service = app.service('todos');
service.create({
text: 'Hi!',
complete: false
}, {}, function(error, todo) {
console.log('Created todo on server', todo);
});;
}, 1000); At the bottom of |
So, i'm stupid ! setInterval(function () {
var service = app.service('todos');
todoService.create({ //!!!!
text: 'Hi!',
complete: false
}, {}, function (error, todo) {
console.log('Created todo on servcer', todo);
});
}, 1000); Thank you for your help ;) |
Yeah sorry, I made that mistake first and edited it later so you probably got the wrong one via email. Thanks and glad I could help! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs. |
Hi how to add element and emit to socket from server ?
The text was updated successfully, but these errors were encountered: