Skip to content

Instantly share code, notes, and snippets.

@wycats
Forked from jescalan/loop.js
Created Nov 16, 2011
Embed
What would you like to do?
Handlebars No Name Loop
// The JSON
array = [
{
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"
}
]
json = { objects: array }
// Handlebars code - I need to loop through the above items.
{{#each objects}}
<li><a href='{{link}}'>{{title}}</a></li>
{{/each}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment