Reputation: 95
I'm using Jade and I have a template and a content block. I can run scripts in the template but how do I run the scripts in the content block?
Here's a bare bones example, mintemplate.jade:
doctype html
html
head
script.
alert('Layout Ready!');
body
h1 Test
block content
and test.jade:
extends minlayout
script.
alert('Content Ready!');
block content
h2 Content
The 'Layout Ready' alert works fine but the 'Content Ready' alert never appears.
Upvotes: 0
Views: 459
Reputation: 10211
you need to move script declaration under block definition
extends minlayout
block content
script.
alert('Content Ready!');
h2 Content
Upvotes: 3