{%= description %}
{%= include("install-npm", {save: true}) %}
var helper = require('{%= name %}');
var handlebars = require('handlebars');
// 1. pass your instance of handlebars
var helper = require('{%= name %}')(handlebars);
// 2. register the helper, name it whatever you want
handlebars.registerHelper('partial', helper);
// 3. register some partials
handlebars.registerPartial('button', '<button>{{text}}</button>');
// 4. use in templates
handlebars.compile('{{partial "button"}}')({text: 'Click me!'});
//=> '<button>Click me!</button>'
Pass a specific context to the partial:
handlebars.compile('{{partial "button" a.b.c}}')({a: {b: c: {text: 'Click me!'}}});
//=> '<button>Click me!</button>'
{%= related(['handlebars-helpers', 'template-helpers']) %}
{%= include("tests") %}
{%= include("contributing") %}
{%= include("author") %}
{%= copyright() %} {%= license() %}
{%= include("footer") %}