Join Joe Marini for an in-depth discussion in this video Using Underscore.js templates, part of Up and Running with Underscore.js.
Okay I'm going to wrap up this part of…the course, by showing you how _ templates work.…Now _ is not full fledged templating library like say, dust is, or mustache, or…handle bars, but it does have templating features in it and it is pretty powerful.…If you find yourself in need of templates, but you don't need the…power of these other libraries, _ templates might be just what you need.…So, that's what I'm going…to cover in this section.…And you can, see I have scrolled down to the templates section here, in my snippets…and I'm going to open up templates_start and we're…going to exercise _ templates feature, in this document.…
As usual, I have my div container down here.…I've got my load event handler right here, and I've got…a function, whose job it is, to put data into the document.…So let's go back to the snippets and…the first thing I'm going to do, is copy this line right here, Var template string.…So I'll copy that, back to the code and paste that into the event listener.…Actually, you know what, No, let's make that a global variable.…
- Understanding what Underscore.js is and does
- Installing Underscore.js
- Sorting, grouping, and filtering data sets
- Extracting information about arrays and objects
- Using templates to format data