Chapter 4. Automatically updating templates with Handlebars.js
This chapter covers
- Understanding why you need templates
- Working with Handlebars.js expressions
- Using simple and complex expressions
- Understanding the relationship between Ember.js and Handlebars.js
- Creating your own custom expressions
Ember.js doesn’t include a default template library, and you’re free to use your favorite JavaScript library. But because the same people who are behind Ember.js are also behind Handlebars.js, Handlebars.js is an especially nice fit for Ember.js applications. Handlebars.js also has all the features that you’re looking for in a solid template library. Handlebars.js is based on Mustache, which is a logic-less template library that exists for many programming languages, including JavaScript, Python, Java, Ruby, and most likely your favorite language.
In this chapter, you’ll start by getting a clear understanding of what a template is and why you should be excited about using one, before moving on to the features that Handlebars.js provides. In the second half of the chapter, you’ll look at how Ember.js extends the standard Handlebars.js features to provide automatically updated templates for your application. This chapter should leave you with a comprehensive understanding of the template features that are built into Handlebars.js and Ember.js.