I'm trying to make Jade work with Meteor's Flow Router and Blaze. Somehow it doesn't work for me. I'm pretty sure it's just something small that I don't notice.
HTML versions of home.jade and layout.jade files give a proper, working result.
According to this, there used to be a problem, but it was solved in 0.2.9 release of mquandalle:jade.
$ meteor list
blaze 2.1.2 Meteor Reactive Templating library
kadira:blaze-layout 2.0.0 Layout Manager for Blaze (works well with FlowRou...
kadira:flow-router 2.3.0 Carefully Designed Client Side Router for Meteor
meteor-platform 1.2.2 Include a standard set of Meteor packages in your...
mquandalle:jade 0.4.3 Jade template language
layout.jade
template(name="layout")
+Template.dynamic(template="main")
home.jade
template(name="home")
p Looks like working!
routes.js
FlowRouter.route('/', {
name: 'home',
action: function() {
BlazeLayout.render('layout', {main: 'home'});
}
});
The result:
<body>
<div id="__blaze-root">
</div>
</body>
Indeed, it is just a subtle detail issue: you should not use quotes around the main
parameter in your layout template:
template(name="layout")
+Template.dynamic(template=main)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With