OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 3 Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 6 --> |
| 7 |
| 8 <html> |
| 9 <head> |
| 10 <title>example</title> |
| 11 <style> |
| 12 .jname { |
| 13 background: #faa; |
| 14 } |
| 15 .fname { |
| 16 border: solid 1px #88f; |
| 17 } |
| 18 </style> |
| 19 </head> |
| 20 |
| 21 <body> |
| 22 <template id="test" bind> |
| 23 <h1>Polymer Expression Syntax</h1> |
| 24 <label> first name: <input value="{{ firstName }}"></label> |
| 25 <label> last name: <input value="{{ lastName }}"></label> |
| 26 <div>Hello {{ getFullName() }}!</div> |
| 27 <div>{{ firstName }} {{ lastName }}</div> |
| 28 <div> |
| 29 <h2>Iteration</h2> |
| 30 <ul> |
| 31 <template repeat="{{ item in items.take(2) }}"> |
| 32 <li>{{ item }}</li> |
| 33 </template> |
| 34 </ul> |
| 35 <ul> |
| 36 <template repeat="{{ people }}"> |
| 37 <li class="{{ {'jname': firstName.startsWith('J'), |
| 38 'fname': lastName.startsWith('F')} }}"> |
| 39 {{ firstName }} {{ lastName }} |
| 40 </li> |
| 41 <ul> |
| 42 <template repeat="{{ item in items }}"> |
| 43 <li checked?="{{ item == 'A'}}">{{ firstName }} {{ item }}</li> |
| 44 </template> |
| 45 </ul> |
| 46 </template> |
| 47 </ul> |
| 48 </div> |
| 49 </template> |
| 50 |
| 51 <template id="test2" bind> |
| 52 <h1>Default Syntax</h1> |
| 53 <label> first name: <input value="{{ firstName }}"></label> |
| 54 <label> last name: <input value="{{ lastName }}"></label> |
| 55 </template> |
| 56 |
| 57 <script type="application/dart" src="example.dart"></script> |
| 58 <script src="packages/browser/dart.js"></script> |
| 59 </body> |
| 60 </html> |
OLD | NEW |