How to return value on Meteor.call() in client?

后端 未结 1 462
囚心锁ツ
囚心锁ツ 2021-01-05 03:20

So I\'ve been using the twitter API w/MeteorJS and what I\'m attempting to do is just display the screen name of the twitter user on the browser. This is what I have done so

相关标签:
1条回答
  • 2021-01-05 04:03

    You need to place a function inside the call to be able to get the return.

    Meteor.call(
        'screenName',
        function(error, result){
            if(error){
                console.log(error);
            } else {
                console.log(result);
            }
        }
    );
    

    You can read more in the documentation about the call function: http://docs.meteor.com/#/full/meteor_call

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