Przeglądaj źródła

adding simple test for dot notation support

tags/0.4.0
John Butler 14 lat temu
rodzic
commit
3ffc6b2828
3 zmienionych plików z 24 dodań i 0 usunięć
  1. +6
    -0
      examples/dot_notation.html
  2. +14
    -0
      examples/dot_notation.js
  3. +4
    -0
      examples/dot_notation.txt

+ 6
- 0
examples/dot_notation.html Wyświetl plik

@@ -0,0 +1,6 @@
<h1>{{name}}</h1>
<p>Price: {{price.currency.symbol}}{{price.value}} {{#price.currency}}{{name}}{{/price.currency}}</p>
<p>VAT: {{price.currency.symbol}}{{price.vat}}</p>
{{#in_stock}}
<p>Available Now</p>
{{/in_stock}}

+ 14
- 0
examples/dot_notation.js Wyświetl plik

@@ -0,0 +1,14 @@
var dot_notation = {
name: "A Book",
price:{
value: 200,
vat: function() {
return this.value * 0.2;
},
currency: {
symbol: '&euro;',
name: 'Euro'
}
},
in_stock: true
};

+ 4
- 0
examples/dot_notation.txt Wyświetl plik

@@ -0,0 +1,4 @@
<h1>A Book</h1>
<p>Price: &euro;200 Euro</p>
<p>VAT: &euro;40</p>
<p>Available Now</p>

Ładowanie…
Anuluj
Zapisz