summaryrefslogtreecommitdiffstats
path: root/posts/demo/demo.md
diff options
context:
space:
mode:
authornimojs <imhadley@163.com>2015-04-19 23:14:19 +0800
committernimojs <imhadley@163.com>2015-04-19 23:14:19 +0800
commitcbaf08642e63b1dc50b99ba5ac41ea1ecc4b7163 (patch)
tree2d2d55cfbd5e9b89a99223d2e30037ed4ba14cae /posts/demo/demo.md
parent720cb5a6ba938cb9864bd24d6df5527b5cdbfa91 (diff)
downloadhandlebarsjs.org-origin/master.zip
handlebarsjs.org-origin/master.tar.gz
handlebarsjs.org-origin/master.tar.bz2
增加章节,静态资源文件目录调整
Diffstat (limited to 'posts/demo/demo.md')
-rw-r--r--posts/demo/demo.md27
1 files changed, 16 insertions, 11 deletions
diff --git a/posts/demo/demo.md b/posts/demo/demo.md
index bbb8833..1c7f30f 100644
--- a/posts/demo/demo.md
+++ b/posts/demo/demo.md
@@ -12,26 +12,31 @@ _PAGEDATA-->
<!-- 模板 -->
<script class="show" id="source" type="text/x-handlebars-template" >
-{{{link "See more..." story.url}}}
+{{#nimo}}
+{{.}} {{root.a.b.c}}
+{{/nimo}}
</script>
<!-- 数据 -->
<script class="show json-format-error" id="data" type="text/json">
{
- "story": {
- "url": "http://www.handlebarsjs.org"
- }
+ "a":{
+ "b":{
+ "c":"cccc"
+ }
+ },
+ "nimo": [
+ 1
+ ,
+ 2
+ ]
}
</script>
<!-- helper实现 -->
<script class="show" id="helper">
-Handlebars.registerHelper('link', function(text, url) {
- url = Handlebars.escapeExpression(url);
- text = Handlebars.escapeExpression(text);
-
- return new Handlebars.SafeString(
- "<a href='" + url + "'>" + text + "</a>"
- );
+Handlebars.registerHelper('helper-name', function(obj) {
+ return 'output'
+
});
</script> \ No newline at end of file