Jade template, how to pass concrete object to pages?

后端 未结 4 510
小鲜肉
小鲜肉 2020-12-08 06:45

I have a jade template for my node.js project. I would like to send an object to the jade template and pass it to a function inside the page (to render something).

I

4条回答
  •  执念已碎
    2020-12-08 07:25

    Oddly enough, for me the solution involved no calls to JSON.parse. I stringified my object on the server and just used the !{vizJson} method and got my object clientside.

    Per the docs, unescaped string interpolation: http://jade-lang.com/reference/interpolation/

提交回复
热议问题