Router.route('/katalog', function () {
this.render('katalog', {
data: function() { return Products.find(); } });
});
=> no rendered data in template:
<template>
{{#each products}}
<div>
<h3>{{name}}</h3>
{{price}}
</div>
{{/each}}
</template>
though in console Products.find() show correct data:
Products.find().fetch()
[Object_id: "bSrJqp3gtGuRQ94BP
name: …name…
price: 1798.5
proto:
Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]
and if i add helper
Template.katalog.helpers({
products(){
return Products.find();
}
});
it shows data,
why is this happening?