How to debug print an object from jade,Like console.log()
in javascript
You can debug with console.log
from jade
like this:
div
- console.log(the_object_you_want_to_log)
div
This helped me! Able to see whole tree of Object in console.
Start script. from leftmost and just give space or tab according to your template before console.log.
script.
console.log(!{JSON.stringify(Object)})
You can debug like this
div
= your_debug_data
div
or formatted style like:
code.formattedDebug #{your_debug_data}
来源:https://stackoverflow.com/questions/32021040/how-to-debug-print-an-object-from-jade