Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Handlebars No Name Loop
// The JSON
[
{
created_at: "2011-10-19T16:22:30Z",
id: 1,
link: "http://abcnews.go.com/Business/video/job-search-social-media-ditch-resume-hunt-nontraditional-ways-internet-professional-contacts-business-13581468",
title: "ABC News: Job Search Through Social Media",
updated_at: "2011-10-19T16:22:30Z"
},
{
created_at: "2011-10-19T16:22:30Z",
id: 2,
link: "http://www.adweek.com/news/advertising-branding/talent-takes-f-train-130622",
title: "Adweek: Talent Takes the F Train",
updated_at: "2011-10-19T16:22:30Z"
},
{
created_at: "2011-10-19T16:22:30Z",
id: 3,
link: "http://www.bloomberg.com/video/68220332",
title: "BloombergTV: Social Media: Connecting to Customers",
updated_at: "2011-10-19T16:22:30Z"
}
]
// Handlebars code - I need to loop through the above items.
{{#each ???}}
<li><a href='{{link}}'>{{title}}</a></li>
{{/each}}
// This renders correctly if I do it - what I need to loop through is that first number, really
<li>{{0.title}}</li>
// renders 'ABC News: Job Search Through Social Media'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment