Reputation: 9579
I am assigning methods to a Meteor server like so:
In bootstrap.js
Meteor.startup(function () {
Meteor.methods({
foo: function () {
return 1;
},
bar: function () {
// QUESTION: HOW TO CALL Meteor.methods.foo
return 1 + foo;
}
});
});
Upvotes: 33
Views: 29944
Reputation: 12085
The same way you would call bar: Meteor.call("foo");
If you are on the server and do not specify a callback the method will run synchronously.
Docs for Meteor.call: http://docs.meteor.com/#meteor_call
Upvotes: 59