Skip to content

Instantly share code, notes, and snippets.

@kwalrath
Last active August 29, 2015 14:26
Show Gist options
  • Save kwalrath/cfeea02a02048cead535 to your computer and use it in GitHub Desktop.
Save kwalrath/cfeea02a02048cead535 to your computer and use it in GitHub Desktop.
web_app
<!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>
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