CHAPTER 4

image

Backbone View and Templating Libraries

The previous chapter focused on the classes and functionality that Backbone provides to power the model layer of your web application. Now the focus shifts to the view layer, with Backbone.View being the main class behind it all. We’ll also look at how templating libraries work to make updating your HTML pages a whole lot easier. As well as looking at Underscore, we’ll spend some time looking at Handlebars and Mustache, two leading template libraries for JavaScript applications.

Code Setup

To execute the code in theexamples, we will continue to use index.html from the previous chapter. Becausewe ...

Get Beginning Backbone.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.