Learn

Watch the video to get an in-depth overview of the code used in the previous exercise. In case you want to watch it at a later time, here is the YouTube link.

The major steps of using Handlebars in a project:

  1. Add the Handlebars library to your project. — one option is to use a Content Delivery Network (CDN): MDN CDN documentation.
  2. Create a Handlebars script in your HTML file.
  3. In your JavaScript file, grab the HTML stored in the Handlebars script.
  4. Use Handlebars.compile() to return a templating function.
  5. Pass in a context object to the templating function to get a compiled template.
  6. Render the compiled template onto the web page.

Instructions

Move on to the next exercise when you’re ready!

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?