Meteor how to call a method defined in Meteor.methods()?

前端 未结 1 1553
刺人心
刺人心 2021-02-11 16:24

I am assigning methods to a Meteor server like so:

In bootstrap.js

Meteor.startup(function () {
    Meteor.methods({

        foo: function () {
                 


        
1条回答
  •  囚心锁ツ
    2021-02-11 16:59

    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

    0 讨论(0)
提交回复
热议问题