Hey guys!
I have a Meteor back-end connected to a Chrome Extension through a DDP client.
On Meteor, I defined a method; on the Extension, I am calling it.
The call itself works, but the callback is not executed. I read through different posts discussing callback errors but couldn’t find a solution to this on any of them.
Meteor
/imports/api/methods.js
Meteor.methods({
'testMethod': function(){
console.log('Test');
return 'Testing';
}
});
Chrome Extension
/chrextension/src/popup.js
(function($){
$('#testButton').click(function(){
ddp.call('testMethod', function(error,result){
console.log('I am here');
console.log(result);
$("h1").text(result);
});
});
})(jQuery);
The console.log on the Method side is executed; those on the Call side are not. The $().text() doesn’t output anything, too.
Any ideas what could be wrong?
Thanks!