Name: handlebars-helper-variable
Owner: Helpers
Description: Handlebars block helper that adds variables to the context that can be used by following expressions in the same template.
Created: 2015-03-19 23:13:33.0
Updated: 2015-03-21 03:58:17.0
Pushed: 2015-03-21 03:58:17.0
Homepage: null
Size: 144
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Handlebars block helper that adds variables to the context that can be used by following expressions in the same template.
i handlebars-helper-variable --save
variable = require('handlebars-helper-variable');
Dyanimcally add JSON objects to the context.
context
{Object}: Context object to put the JSON object on.Register the helper with Handlebars
variable = require('handlebars-helper-variable');
context = {};
lebars.registerHelper('variable', variable(context));
Use the helper in a Handlebars template.
ariable "foo"}}
"foo": "bar" }
ariable}}
Compile and render the template with the given context.
lebars.compile(template)(context);
context = { foo: { foo: 'bar' } }
Install dev dependencies:
i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Brian Woodward
Copyright (c) 2015 Brian Woodward
Released under the MIT license
This file was generated by verb-cli on March 20, 2015.