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:
- Add the Handlebars library to your project. — one option is to use a Content Delivery Network (CDN): MDN CDN documentation.
- Create a Handlebars script in your HTML file.
Handlebars.compile()to return a templating function.
- Pass in a
contextobject to the templating function to get a compiled template.
- Render the compiled template onto the web page.
Move on to the next exercise when you’re ready!