…Mustache templates also have a concept known as Sections.…And, this is how you deal with repeating data in Mustache templates.…So, to define a Mustache section, you use the same double brace notation,…but you put a little pound or hash symbol next to the section name.…And then, you close it off with the double braces but a forward slash.…So, if you have repeating data, say, in an array or something,…this is how you can loop over the contents of that array.…
So, let's take a look at this in action.…And it'll become pretty clear.…So, let's go over to the code.…So, here in the code, in chapter three, scroll down to the line on sections…in mustache chapter, and we're going to copy these lines right here.…Okay, so we'll copy the, copy this code, and we'll paste it into the document.…So open up mustache sections_start.…And we're going to paste that in here.…
So, so far this is pretty similar to the last example.…Right.…So we get the template definition, get the html for it, call Mustache.render.…Right.…Here's about your data.…
- What is templating?
- Defining templates in jQuery Template
- Using simple Mustache templates with sections and conditions
- Adding conditionals and loops to Handlebars templates
- Working with Dust templates
Skill Level Intermediate
What is templating?5m 12s
2. jQuery Template
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.