I have the following templates:
<template name="reportsContent">
<ul class="tabs">
<li class="tabs-content" data-content="summary">
<div class="tabs-content-wrapper">
{{> reportsSummary }}
</div>
</li>
<li class="tabs-content" data-content="invoices">
<div class="tabs-content-wrapper">
{{> reportsInvoices }}
</div>
</li>
<li class="tabs-content" data-content="patients">
<div class="tabs-content-wrapper">
{{> reportsPatients }}
</div>
</li>
</ul>
</template>
<template name="reportsSumary">
....
</template>
<template name="reportsPatients">
....
</template>
I’ve attached a publication to the reportsSummary
template, yet it seems to be extending to the reportsPatients
template too. I’m not sure why since I’ve followed the correct method to define pubs/subs (I think…)
Here’s my publication:
Meteor.publish('appointments.day.patients', function () {
var thisMonth = new RegExp(moment().format('MMM YYYY'));
return Appointments.find({
date_created: { $regex: thisMonth }
}, { fields: { date_created: 1 } });
});
And here’s my subscription:
Template.reportsSummary.onCreated(function () {
this.subscribe('appointments.day.patients');
});
It’s not that what I have is breaking any functionalities per se. I’m just worried about efficiency when the app has a whole lot of data that it has to sift through. Am I missing something here?