I have a Node.js project that is using Jade for the html templating, and on the client side I am using Ember.js with Handlebars. I have a value that I pass into my Jade template from my routes file
home.js
app.get('/', function(req, res) {
res.render('index', { title: 'Home Page. ', flickrApiKey: nconf.get('flickr:apiKey') })
});
and then inside of the jade file
index.jade
{{#view Piccee.FlickrHeaderView api_key=!{flickrApiKey}}}
The line in index.jade does not work however, but if I change it to
{{#view Piccee.FlickrHeaderView api_key=123}}
it does work. So, I just need to figure out how to pass a Jade variable into a Handlebars call.
Not exactly sure what you are attempting but this works:
<script type="text/x-handlebars">
<p>Your first name is #{firstName}</p>
<!-- and then inside a view -->
{{#view}}
<span>#{firstName}</span>
{{/view}}
</script>
Accessing template variables inside .jade files works by prefixing # sign
Hope this helps!