This is what I have:
Template.publicnewsjson.helpers({
news:function(){
return news.find({}, { sort: {date:-1} } );
},
newscount:function(){
return news.find().count();
}
});
<template name="publicnewsjson">
<pre>
{{#each news}}
{
Title:{{title}}
Date:{{friendlydate this.date}}
Abstract:{{abstract}}
HeadlineImagePath:{{headlineimagepath}}
URL:{{url}}
Source:{{source}}
}, <------- This is the comma that I want to remove in the last repetition
{{/each}}
</pre>
</template>
How do I make a statement to get the comma in the last repetition? I was trying something like?:
{{#if newscount @index}} but it does not work.