Why if I write this:
/client/Items.js
Template.Items.onCreated(function() {
console.log('Methor.call');
Meteor.call('Items.findAll', function (err, resp) {
console.log('Methor.call callback');
// Here I will use resp expecting it contains the response
// returned by the method
// ...
return;
});
return;
});
/ItemsMethods.js
Meteor.methods({
'Items.findAll': function () {
return Items.find({});
}
});
the callback is silently ignored, i.e. it is not executed and I don't get any error?
Note that if I replace this return Items.find({});
with this return Items.find({}).fetch();
all works as expected.