Last active
August 29, 2015 14:26
-
-
Save kwalrath/cfeea02a02048cead535 to your computer and use it in GitHub Desktop.
web_app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>web_app</title> | |
</head> | |
<body> | |
<div id="registration"></div> | |
<script type="application/dart" src="main.dart"></script> | |
<!-- for this next line to work, your pubspec.yaml file must have a dependency on 'browser' --> | |
<script src="packages/browser/dart.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:html'; | |
main() { | |
var button = new ButtonElement(); | |
button | |
..id = 'confirm' | |
..text = 'Confirm' | |
..classes.add('important') | |
..onClick.listen((e) => window.alert('Confirmed!')); | |
querySelector('#registration').children.add(button); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment