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

Problem

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

Solution

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

Details

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')

References

Clone this wiki locally