Partials & Utils in Handlebars

PARTIALS Let's say we have a structure like the following : data = { students : [{ name : 'ABC', roll : 1 }, { name : 'DEF', roll : 2 }, { name : 'GHI', roll : 3 }], subject : [{ name : "Programming in C", credits : 4 }, { name : … Continue reading Partials & Utils in Handlebars

Advertisements

Block Helpers [Built-in & Custom]

In the last post, we discussed blocks and contexts. We used {{#each}} in that post, known as "Each Block Helper". So, what is a block helper? Block helpers make it possible to define custom iterators and other functionality that can invoke the passed block with a new context. [Handlebars Docs] Handlebars give us some built-in … Continue reading Block Helpers [Built-in & Custom]

Handlebars – Basic Syntax

In this blog we are going to look into¬†basic syntax for writing handlebar templates. There are 4 steps¬†you need to follow 1. Include jQuery and Handlebars library to your HTML file 2. Define your template. 3. Compiling template into a function, pass data to function and appending it to required HTML element Include jQuery and … Continue reading Handlebars – Basic Syntax

Handlebars.js An Overview

In my last blog we understood the importance of Client Side Templating. In this blog I am going to explain the basics of Handlebars.js. Lets get started. Handlebars.js was started by Yehuda Katz. It is built upon mustache, which is logic-less. Logic-less here means that there are no logical statements (If-else,switch etc) but in mustache … Continue reading Handlebars.js An Overview