Server method's callback to client's function as callback

Dear meteor members,

I have got a button on the page calling a method in the server side function as method but I would like to pass a in my client page’s function as callback :slight_smile:

I tried to pass but it is coming as null.

Is it possible?

Please post code so we can see what you’re doing.

I agree with drollins that you should add code but generally speaking, anything you return from the server side method will be part of the callback of the on client side. e.g:


   "returnStringMethod"(args) {
       return "the string I returned"

Client:"returnStringMethod", args, (err, res) => {

will show “the string I returned” in the console.
More infos:

1 Like