Jade newbie here.
I'm aware that in Jade you are allowed to create js variables and interpolate them in seamlessly with html like so:
- var myname = "john"
p my name is #{myname}
However what if that variable were to come from an external .js file (or, if impossible, an external .jade file)?
file.js:
var myname = "john";
and then the index.jade:
- include file.js
p my name is #{myname} //this does not work
I'm not sure whether the render function has anything to do with this. If someone could be so generous as to explain this in plain English, it would be greatly appreciated.
include just includes the raw text if the file is not a Jade file. More info
So - include file.js wouldn't parse any of it's content.
It should work for another Jade file though.
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