Tasks
이라는 작업이 적은 Collection
이 있다고 가정합니다.
작업 배열을 사용자에게 반환하는 메서드를 호출하지만 어떤 이유로 든 아무 것도 반환하지 않습니다. 나는 메서드를 호출 할 때Meteor 방법이 작동하지 않습니다.
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
tasks: function() {
// Show newest tasks first
Meteor.call("getTasks", function(error, result) {
return result; // Doesn't do anything..
});
}
});
}
Meteor.methods({
getTasks: function() {
return Tasks.find({}, {sort: {createdAt: -1}});
}
});
어떤 아이디어 것은 왜 아무것도 반환하지 않습니다 여기에
는 예를 들어 코드?
가능한 [템플릿 도우미 내부의 유성 메소드 사용 방법] (http://stackoverflow.com/questions/22147813/how-to-use-meteor-methods-inside-of-a-template-helper) –