Skip to content

Instantly share code, notes, and snippets.

@timaschew
Last active August 29, 2015 14:15
Show Gist options
  • Save timaschew/034c735f2deceb97d874 to your computer and use it in GitHub Desktop.
Save timaschew/034c735f2deceb97d874 to your computer and use it in GitHub Desktop.
loop over an array via a mixin
{
externalArray: [
{id: 1, name: "foo"},
{id: 2, name: "bar"},
{id: 3, name: "qux"}
]
}
mixin showList(list)
div.container
each item in list
div.item
span=item.id
span=item.name
+showList(externalArray)
@timaschew
Copy link
Author

go on this site: http://jade-lang.com/demo/
put the locals in the top right textarea and the template into top left textarea
see the result in the bottom right textarea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment