本網站在啟用 JavaScript 的情況下可以運作的更好。
首頁
探索
說明
登入
jan
/
mustache.js
镜像来自
https://github.com/janl/mustache.js
關注
1
收藏
0
複製
0
程式碼
問題
0
版本發佈
46
Wiki
活動
瀏覽代碼
improve test with undefined/null lookup hit using dot notation
tags/v2.1.1
David da Silva
Phillip Johnsen
11 年之前
父節點
fc6d73b353
當前提交
931f49b5da
共有
3 個檔案被更改
,包括
24 行新增
和
1 行删除
分割檢視
Diff Options
Show Stats
Download Patch File
Download Diff File
+14
-1
test/_files/null_lookup_object.js
+6
-0
test/_files/null_lookup_object.mustache
+4
-0
test/_files/null_lookup_object.txt
+ 14
- 1
test/_files/null_lookup_object.js
查看文件
@@ -14,5 +14,18 @@
"name": "Chris",
"twitter": undefined
}
]
],
"favorites": {
"color": "blue",
"president": "Bush",
"show": "Futurama"
},
"mascot": {
"name": "Squid",
"favorites": {
"color": "orange",
"president": undefined,
"show": null
}
}
})
+ 6
- 0
test/_files/null_lookup_object.mustache
查看文件
@@ -1,3 +1,9 @@
{{#fobject}}
{{name}}'s twitter: {{#twitter}}{{.}}{{/twitter}}{{^twitter}}unknown{{/twitter}}.
{{/fobject}}
{{#mascot}}
{{name}}'s favorite color: {{#favorites.color}}{{.}}{{/favorites.color}}{{^favorites.color}}no one{{/favorites.color}}.
{{name}}'s favorite president: {{#favorites.president}}{{.}}{{/favorites.president}}{{^favorites.president}}no one{{/favorites.president}}.
{{name}}'s favorite show: {{#favorites.show}}{{.}}{{/favorites.show}}{{^favorites.show}}none{{/favorites.show}}.
{{/mascot}}
+ 4
- 0
test/_files/null_lookup_object.txt
查看文件
@@ -1,3 +1,7 @@
Flor's twitter: @florrts.
Miquel's twitter: unknown.
Chris's twitter: unknown.
Squid's favorite color: orange.
Squid's favorite president: no one.
Squid's favorite show: none.
Write
Preview
Loading…
取消
儲存