If I subscribe multiple collections:
Meteor.subscribe('categories'); Meteor.subscribe('tags');
That all have the same attribute (e.g., ‘dateCreated’), and I use that attribute in a blaze template,
which value will appear?
<h1>{{dateCreated}}</h1>
If I subscribe multiple collections:
Meteor.subscribe('categories'); Meteor.subscribe('tags');
That all have the same attribute (e.g., ‘dateCreated’), and I use that attribute in a blaze template,
which value will appear?
<h1>{{dateCreated}}</h1>
You need to create a helper to pass the data to Blaze. Try this:
HTML
<template name="myTemplate">
{{#each tags}}
<div>{{dateCreated}}</div>
{{/each}}
</template>
JS
Template.myTemplate.helpers({
tags:function(){
return Tags.find()
}
});