gruntjs / grunt-contrib-handlebars

Precompile Handlebars templates to JST file.
http://gruntjs.com/
MIT License
283 stars 126 forks source link

How to add Custom Helpers #142

Open standon1978 opened 9 years ago

standon1978 commented 9 years ago

I have created a set of custom helpers which I want to include with my build (AMD). Where do I specify the path of helpers to be included.

skotchio commented 9 years ago

@standon1978 I have the save problem. Did you find a way?

standon1978 commented 9 years ago

I am included the following in my gruntfile. Option 1: grunt.config('handlebars.options.amd', ['handlebars','helper/hbs/helpers']); Here handlebars is the handlebars.js file location and helper/hbs/helpers is the cutom helper/hbs/helpers.js file with my helpers I am using requireJs so was able to specify all the AMD modules to be loaded as an array. Option2: At the start of you application you can initialize the custom handlebars class manually which basically attaches your template on the handlebar object. Regards,Sameer Tandon

Date: Sun, 23 Aug 2015 11:31:01 -0700 From: notifications@github.com To: grunt-contrib-handlebars@noreply.github.com CC: sa_tandon@hotmail.com Subject: Re: [grunt-contrib-handlebars] How to add Custom Helpers (#142)

@standon1978 I have the save problem. Did you find a way?

— Reply to this email directly or view it on GitHub.