我正在为Meteor服务器分配方法,如下所示:
在bootstrap.js中
Meteor.startup(function () {
Meteor.methods({
foo: function () {
return 1;
},
bar: function () {
// QUESTION: HOW TO CALL Meteor.methods.foo
return 1 + foo;
}
});
});
Run Code Online (Sandbox Code Playgroud)
gre*_*reg 57
你可以这样称呼bar: Meteor.call("foo");
如果您在服务器上并且未指定回调,则该方法将同步运行.
Google文件Meteor.call: http://docs.meteor.com/#meteor_call
| 归档时间: |
|
| 查看次数: |
29157 次 |
| 最近记录: |