In a swig file I want to see all available properties that it is receiving.
Is there a way to access it? Or can I only access its properties?
.js
res.render('list.swig', result);
list.swig
{{ Model|json }}
答案 0 :(得分:0)
我认为你能做到的唯一方法是在node_modules
下打开swig并转到/lib/swig.js
。然后找到code for renderFile
。
有三个参数pathName
,locals
,cb
。您可以对pathName
进行条件检查,如果您正在寻找,可以记录locals
。