Permalink
Browse files

Sample for conditionals

  • Loading branch information...
1 parent 7f35418 commit 772ecd04044ef9f03d8d3067284a18af49e4df57 @olado committed Dec 28, 2011
Showing with 10 additions and 1 deletion.
  1. +9 −0 examples/advancedsnippet.txt
  2. +1 −1 examples/withdoT.js
@@ -52,3 +52,12 @@ Compare xyz to 1, show 'xyz is not 1' if false:
#}}
{{#def.fntest()}}
+
+Conditionals:
+{{? it.altEmail }}
+
+<p>
+second email: {{= it.altEmail }}
+</p>
+
+{{?}}
View
@@ -1,7 +1,7 @@
(function() {
var doT = require('../doT.js'),
fs = require('fs'),
- data = { f1: 1, f2: 2, f3: 3},
+ data = { f1: 1, f2: 2, f3: 3, altEmail: "conditional works"},
defs = { a: 100, b: 200};
defs.loadfile = function(path) {

0 comments on commit 772ecd0

Please sign in to comment.