Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
niceue committed Apr 19, 2014
1 parent 6fdf3ce commit 6a16ad9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ Or in sea.js, you can include by: `var tpl = require('path/to/tpl');`
2. Template in your html:
``` html
<script type="text/template" id="demo">
<p>Hi, I'm <%=author%></p>
<p>Hi, I'm <#=author#></p>
<p>I can write:
<% for(var i=0; i<languages.length; i++) { %>
<%=(i===0?"":",")+languages[i]%>
<%}%>
<# for(var i=0; i<languages.length; i++) { #>
<#=(i===0?"":",")+languages[i]#>
<#}#>
</p>
</script>
```
Or use internal method `echo()`:
``` html
<script type="text/template" id="demo">
<p>Hi, I'm <%=author%></p>
<p>Hi, I'm <#=author#></p>
<p>I can write:
<%
<#
for(var i=0; i<languages.length; i++) {
echo( (i===0?"":", ") + languages[i] );
}%>
}#>
</p>
</script>
```
Expand All @@ -50,6 +50,7 @@ Or use internal method `echo()`:
```

## API
##### Include another template: `<# include("#tpl_id") #>`
##### Get HTML: `tpl(template, data)`
##### Get HTML: `tpl(template)(data)`
##### Precompiled: `tpl(template)`
Expand Down

0 comments on commit 6a16ad9

Please sign in to comment.