| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 for details. All rights reserved. Use of this source code is governed by a | 4 for details. All rights reserved. Use of this source code is governed by a |
| 5 BSD-style license that can be found in the LICENSE file. | 5 BSD-style license that can be found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <html> | 8 <html> |
| 9 <head> | 9 <head> |
| 10 <title>example</title> | 10 <title>example</title> |
| 11 </head> | 11 </head> |
| 12 | 12 |
| 13 <body> | 13 <body> |
| 14 <template id="test" bind syntax="fancy"> | 14 <template id="test" bind syntax="fancy"> |
| 15 <h1>Fancy Syntax</h1> | 15 <h1>Fancy Syntax</h1> |
| 16 <label> first name: <input value="{{ firstName }}"></label> | 16 <label> first name: <input value="{{ firstName }}"></label> |
| 17 <label> last name: <input value="{{ lastName }}"></label> | 17 <label> last name: <input value="{{ lastName }}"></label> |
| 18 <div>Hello {{ getFullName() }}!</div> | 18 <div>Hello {{ getFullName() }}!</div> |
| 19 <div>{{ firstName }} {{ lastName }}</div> | 19 <div>{{ firstName }} {{ lastName }}</div> |
| 20 <template bind="{{ firstName }}"> | |
| 21 <div>first name: {{ }}</div> | |
| 22 </template> | |
| 23 <div> | 20 <div> |
| 24 <h2>Iteration</h2> | 21 <h2>Iteration</h2> |
| 25 <ul> | 22 <ul> |
| 26 <template repeat="{{ item in items }}"> | 23 <template repeat="{{ item in items.take(2) }}"> |
| 27 <li>{{ item }}</li> | 24 <li>{{ item }}</li> |
| 28 </template> | 25 </template> |
| 29 </ul> | 26 </ul> |
| 30 <ul> | 27 <ul> |
| 31 <template repeat="{{ people }}"> | 28 <template repeat="{{ people }}"> |
| 32 <li>{{ firstName }} {{ lastName }}</li> | 29 <li>{{ firstName }} {{ lastName }}</li> |
| 33 <ul> | 30 <ul> |
| 34 <template repeat="{{ item in items }}"> | 31 <template repeat="{{ item in items }}"> |
| 35 <li>{{ firstName }} {{ item }}</li> | 32 <li>{{ firstName }} {{ item }}</li> |
| 36 </template> | 33 </template> |
| 37 </ul> | 34 </ul> |
| 38 </template> | 35 </template> |
| 39 </ul> | 36 </ul> |
| 40 </div> | 37 </div> |
| 41 </template> | 38 </template> |
| 42 | 39 |
| 43 <template id="test2" bind> | 40 <template id="test2" bind> |
| 44 <h1>Default Syntax</h1> | 41 <h1>Default Syntax</h1> |
| 45 <label> first name: <input value="{{ firstName }}"></label> | 42 <label> first name: <input value="{{ firstName }}"></label> |
| 46 <label> last name: <input value="{{ lastName }}"></label> | 43 <label> last name: <input value="{{ lastName }}"></label> |
| 47 </template> | 44 </template> |
| 48 | 45 |
| 49 <script type="application/dart" src="example.dart"></script> | 46 <script type="application/dart" src="example.dart"></script> |
| 50 <script src="packages/browser/dart.js"></script> | 47 <script src="packages/browser/dart.js"></script> |
| 51 </body> | 48 </body> |
| 52 </html> | 49 </html> |
| OLD | NEW |