cea0d08c1d
Fixed textnode bug, whitespace was being removed. Added added local name for #with and #each. Form of ${#each list [localName]} and ${#with object [localNme]} Added ability to call another template (located in the same tmpl file). Form is ${#templateName(parms)}
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9728009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5665 260f80e4-7a28-3924-810f-c04153c831b5
26 lines
492 B
Dart
26 lines
492 B
Dart
// Sample for #with templates:
|
|
//
|
|
// productview.tmpl
|
|
// productview2.tmpl
|
|
|
|
|
|
#import('dart:html');
|
|
#source('nestedview.dart');
|
|
|
|
class Person {
|
|
String name;
|
|
int age;
|
|
|
|
Person(this.name, this.age);
|
|
}
|
|
|
|
void main() {
|
|
// Simple template.
|
|
Person person1 = new Person("Aristotle - Bugger for the bottle", 52);
|
|
Person person2 = new Person("René Descartes - Drunken fart", 62);
|
|
|
|
NestedView view = new NestedView(person1, person2);
|
|
document.body.elements.add(view.root);
|
|
}
|
|
|