Skip to content

Commit

Permalink
added example for issue #137
Browse files Browse the repository at this point in the history
  • Loading branch information
olado committed Jan 13, 2015
1 parent beaa3a0 commit 195025f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions examples/advancedsnippet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,20 @@ Array iterators

{{#def.block1:{a:1, b:2} || ''}}

{{##def.testFunctionWithParam = function(str) {
return "My name is: " + str;
}
#}}

{{##def.mytestparam: {{=it.name}} #}}
{{#def.testFunctionWithParam(def.mytestparam)}}

{{#def.testFunctionWithParam("\{\{=it.name\}\}")}}

{{##def.testParamDef:myparam:
My name is: {{=myparam}}
#}}

{{#def.testParamDef:it.name}}

The end
2 changes: 1 addition & 1 deletion examples/withdoT.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
var doT = require('../doT.js'),
fs = require('fs'),
data = { f1: 1, f2: 2, f3: 3, altEmail: "conditional works", farray:[{farray:[1,2,3,[11,22,33]],person:{name:'Ell',age:23}},{farray:{how:'really'}}, {farray:[5,6,7,8]}]},
data = { name: "Foo", f1: 1, f2: 2, f3: 3, altEmail: "conditional works", farray:[{farray:[1,2,3,[11,22,33]],person:{name:'Ell',age:23}},{farray:{how:'really'}}, {farray:[5,6,7,8]}]},
defs = { a: 100, b: 200};

defs.loadfile = function(path) {
Expand Down

0 comments on commit 195025f

Please sign in to comment.