platform/packages/jael/jael_web/example/main.dart
Tobe O edfd785dfe Add 'packages/jael/' from commit 'af168281d94cda98a8fd333618696e92f4e035c5'
git-subtree-dir: packages/jael
git-subtree-mainline: 834de0300f
git-subtree-split: af168281d9
2020-02-15 18:22:11 -05:00

30 lines
570 B
Dart

import 'package:jael_web/jael_web.dart';
import 'package:jael_web/elements.dart';
part 'main.g.dart';
@Jael(template: '''
<div>
<h1>Hello, Jael!</h1>
<i>Current time: {{now}}</i>
</div>
''')
class Hello extends Component with _HelloJaelTemplate {
DateTime get now => DateTime.now();
}
// Could also have been:
class Hello2 extends Component {
DateTime get now => DateTime.now();
@override
DomNode render() {
return div(c: [
h1(c: [
text('Hello, Jael!'),
]),
i(c: [
text('Current time: $now'),
]),
]);
}
}