Answer the question
In order to leave comments, you need to log in
I can not understand why the array is not displayed in the template?
Tell the noob what I'm doing wrong? If you output to the console, then the array will be displayed.
Meteor.call("getPosts", function (error, results) {
Template.PostList.helpers({
posts: results.data
})
});
Answer the question
In order to leave comments, you need to log in
Template.PostList.onCreated(function() {
Meteor.call("getPosts", function(error, results) {
return Session.set('posts', results);
});
});
Template.PostList.helpers({
posts: function() {
return Session.get('posts');
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question