Permalink
Browse files

Pass the index into template functions as a second argument. Useful f…

…or collections (zebra-striping table rows, etc.).
  • Loading branch information...
1 parent 806490f commit 1adac36486145688bc1b2acecda96526a61cc2cb @savetheclocktower savetheclocktower committed with erikvold Jan 22, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Template.js
View
@@ -38,7 +38,7 @@ Jaml.Template.prototype = {
with(this) {
for (var i=0; i < data.length; i++) {
- eval("(" + this.tpl.toString() + ")(data[i])");
+ eval("(" + this.tpl.toString() + ")(data[i], i)");
};
}

0 comments on commit 1adac36

Please sign in to comment.