Strona działa najlepiej z włączonym JavaScript.
Strona główna
Odkrywaj
Pomoc
Zaloguj się
jan
/
mustache.js
kopia lustrzana
https://github.com/janl/mustache.js
Obserwuj
1
Polub
0
Forkuj
0
Kod
Zgłoszenia
0
Wydania
46
Wiki
Aktywność
Przeglądaj źródła
improve test with undefined/null lookup hit using dot notation
tags/v2.1.1
David da Silva
Phillip Johnsen
11 lat temu
rodzic
fc6d73b353
commit
931f49b5da
3 zmienionych plików
z
24 dodań
i
1 usunięć
Widok podzielony
Opcje porównania
Pokaż statystyki
Ściągnij plik aktualizacji
Ściągnij plik porównania
+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
Wyświetl plik
@@ -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
Wyświetl plik
@@ -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
Wyświetl plik
@@ -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.
Napisz
Podgląd
Ładowanie…
Anuluj
Zapisz