I iterate through a collection in Meteor using {{#each}} and I would like to know if I am in the last element, how can I do this in AngularJS when using ngRepeat with $ last.
It can be used, for example, to create human-readable listings like "I like cats, dogs and dolphins":
Template.myTemplate.helpers({ likedAnimals: function(){return ['dogs','cats','dolphins'];} }); <template name='myTemplate'> I like {{#each likedAnimals}} {{#if !$first && !$last}}, {{/if}} {{#if $last}} and {{/if}} {{this}} {{/each}} </template>
Is there a way to test this condition in Meteor?
javascript meteor spacebars meteor-blaze
Gerard carbó
source share