2019-03-23 14:07:40 +00:00
|
|
|
import 'package:jael_web/jael_web.dart';
|
2019-03-23 18:49:37 +00:00
|
|
|
import 'package:jael_web/elements.dart';
|
|
|
|
part 'main.g.dart';
|
2019-03-23 14:07:40 +00:00
|
|
|
|
2019-03-23 18:49:37 +00:00
|
|
|
@Dsx(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'),
|
|
|
|
]),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|