OLD | NEW |
1 // Sample for #with templates: | 1 // Sample for #with templates: |
2 // | 2 // |
3 // productview.tmpl | 3 // productview.tmpl |
4 // productview2.tmpl | 4 // productview2.tmpl |
5 | 5 |
6 | 6 |
7 #import('dart:html'); | 7 import 'dart:html'; |
8 #source('productview.dart'); | 8 part 'productview.dart'; |
9 | 9 |
10 class Person { | 10 class Person { |
11 String name; | 11 String name; |
12 int age; | 12 int age; |
13 | 13 |
14 Person(this.name, this.age); | 14 Person(this.name, this.age); |
15 } | 15 } |
16 | 16 |
17 void main() { | 17 void main() { |
18 // Simple template. | 18 // Simple template. |
19 Person person = new Person("Terry Lucas", 52); | 19 Person person = new Person("Terry Lucas", 52); |
20 ProductView view = new ProductView(person); | 20 ProductView view = new ProductView(person); |
21 document.body.elements.add(view.root); | 21 document.body.elements.add(view.root); |
22 } | 22 } |
23 | 23 |
OLD | NEW |