Hello Meteorites, I’ve tried posting this question on Stack Overflow but I’ve got no answer so fare, so I’m bringing this to your attention hoping you can help me here (I’m getting started with Meteor)
The issue is with meteor-pages package.
I am setting up meteor-pages like so
Snippets = new Mongo.Collection('snippets');
this.Pages = new Meteor.Pagination("Snippets", {
perPage: 3
});
Pages.set({
perPage: 3,
sort: {
title: -1
}
});
in my router
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
waitOn: function(){
return Meteor.subscribe('snippets');
}
});
in my templates
<template name="snippets">
{{>snippetsList}}
{{> pages}}
{{> pagesNav}}
</template>
<template name="snippetsList">
<div>
{{#each snippet}}
<div>
<p>{{text}}</p>
<a href="{{pathFor 'snippetEdit'}}" class="btn btn-default btn-sm edit">Edit</a>
<button type="button" class="btn btn-default btn-sm btn-danger delete">Delete</button>
</div>
{{/each}}
</div>
</template>
What do you think? What’s wrong? Many thanks!