I'd like to include an external js file and use util functions from it. I use jade compile to generate an html doc, which then gets converted to pdf. What is the right way to achieve this? I have tried an include, and a script tag with src attribute. In both the options i get function undefined error.
Pls help.
- Rajesh
- var formatNumber = function() { return('100,000') }
p Amount is #{formatNumber(100000)}!
var jade = require('jade');
function formatNumber() {
return('100,000')
}
// Compile
var fn = jade.compile('p Amount is #{formatNumber(100000)}!');
// Render
var html = fn({formatNumber: formatNumber});
--
You received this message because you are subscribed to a topic in the Google Groups "Jade" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jadejs/bAkWusToP2o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jadejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.