Skip to content

Debug a template

Scott Erickson edited this page Feb 25, 2016 · 1 revision


You want to see what's going on within a template while it is executing.


Drop in console.log calls as you would inside a view.


Jade is compiled into a JavaScript function which takes a context object and returns an HTML string. You can use any JavaScript you'd like be prefixing with -.

for item in view.items.models
  - console.log('Looping through item', item);
  p= item.get('name')


Clone this wiki locally
You can’t perform that action at this time.