gruntjs / grunt-contrib-handlebars

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

handlebars with grunt #149

Closed douglasdeodato closed 9 years ago

douglasdeodato commented 9 years ago

I am using grunt to compile my handlebars templates, I got stuck when I try run my template in my HTML, if I Use chrome console I can run my template, but it not load when I call inside my javascript.

I using handlebars.runtime.js, I can see in my code its getting compiled looks great I just have no idea how to implement that in my HTML.

if I use that on my console prints my template, i would like run and see that on my HTML:

myapp.templates.user({name:"doug"}); http://pastebin.com/ZWiDzWS2

I really sure the error is in: lib/call-templates.js on that line:

html = Handlebars.template'./templates/user.hbs';

I tried any path and config but I have no sucess.

grunfile.js http://pastebin.com/BimnAydn

lib/ call-templates.js http://pastebin.com/qD3QEMQh

templates/user.hbs http://pastebin.com/sUbnJYLD

tmp/templates.js http://pastebin.com/AzBPPNyC

vladikoff commented 9 years ago

Sorry for slow response, questions like this are better asked on StackOverflow. I'm not sure what exactly the problem is