…Just like Mustache and Handlebars, Dust has the concept of Sections.…And, that's what we're going to examine in this example.…So, in the snippets code, scroll down to chapter five,…under Dust, and let's bring up this Sections area right here.…And let's open up DustSections_start.…Couple things to point out.…So I'm going to be using jQuery here, just…for some convenience to get some JSON data.…And I'm using the full version of the Dust library, right here.…
My code uses the addEventListener, to listen for the window to load.…And then it calls renderTemplates.…RenderTemplates starts off by getting some JSON data,…using jQuery, and that's this file right here.…So, that's templateData.json and I've got it here,…in the root level of the Exercise files.…And, let's open that and see that this is…a file that contains some information about a fictitious company.…And, here's some employees.…There's an array of objects, each one of them representing some data.…Alright, so, let's go back to the code.…So, we've done here, what we've been doing in the previous examples.…
- 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.