Injectify include helper
Additional helper for handlebars, include template into template. Work similar to partials but with browserify
.
Install
npm install --save-dev injectify injectify-include
Usage
Configure gulp
:
var gulp = browserify = source = ; gulp;
In file ./src/index.js
require injectify include
helper:
;
Now you can use include
helper in your templates:
<h1>Example</h1> <p>{{include "./other-template.hbs"}}</p> <p>You also may pass params to template</p> <p>{{include "./other-template.hbs" value=123 id=userId}}</p>
include
helper works like original browserify require
. You can require modules relative to template file or
node_modules directory.
Changelog
v2.0
- Handlebars 3.0
- Injectify 2.0