…Handlebars provides some facilities for doing things like…conditionals and some basic logic inside your templates.…And that's what we're going to look at here.…So, in chapter four under the handlebars section in your snippets file, scroll down…to the Conditionals and Loops section, and let's open up HandbarsCond_start.…Okay, so you can see here that I've already started off the file.…And, we've got our renderer here, and we…have the rendering function being called with the data.…
And down here, we need to fill out our template.…So let's go to the snippets, and let's…start off by copying this block right here.…And let's paste it in.…Okay.…Now, in this case I'm using one of the built…in looping functions that handlebars has called the each operator.…And the each operator will take whatever the content of the argument you passed to…it, in this case, I'm giving it the…employees structure, and it will loop over it.…And just as an aside, you can see that I've also got a comment in here.…
And just like in mustache, you can put…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.