V
V
vechnomolodoy2017-04-05 02:51:14
meteor
vechnomolodoy, 2017-04-05 02:51:14

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

1 answer(s)
S
Salafan Packages, 2017-04-18
@vechnomolodoy

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 question

Ask a Question

731 491 924 answers to any question