How to do script function use in the jade?

21 views
Skip to first unread message

HenLy

unread,
Apr 8, 2015, 12:40:53 AM4/8/15
to jad...@googlegroups.com
Ex_Jade


block title
    title Test Jade
block content
    h1 Test Jade

    script.
       function makefunc(ObjectA, ObjectB){
                return ObjectA+ ObjectB;
       }

    pre=#{JSON.stringify(makefunc(A,B), null, 2)}   <- I want to use function made to  scriptblock



how to do it?



Marcel Miranda

unread,
Apr 8, 2015, 5:47:55 PM4/8/15
to jad...@googlegroups.com
makeFunc is available to the client context, but not to the jade context, if you want to use like this you should pass it as a local when you compile the template.

--
You received this message because you are subscribed to the Google Groups "Jade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jadejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages