node.js - Pulling items from a collection using Handlebars -
i using node.js express , mongodb database utilizing mongoose , handlebars templating engine. have collection in database named players. have defined model, player.js, provides schema collection. when user enters players information gets stored database correctly. trying create list show playername , team on players homepage every player gets created. code have been trying write in handlebars:
<div class="widget"> <ul> {{#each players}} <li><a href="#">{{playername}}, {{team}}</a></li> {{/each}} </ul> </div>
can me understand how access each of items in question?
Comments
Post a Comment