Created
March 5, 2015 18:22
-
-
Save ratbeard/70902d6347ad448de0a4 to your computer and use it in GitHub Desktop.
dart!
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); | |
} |
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
brew install dart dartium | |
brew linkapps dartium | |
cd /tmp | |
mkdir dart | |
cd dart | |
# Copied 'html' sample found at https://www.dartlang.org/docs/dart-up-and-running/ch01.html | |
dart/ | |
› pst > a.dart | |
dart/ | |
› time dart2js a.dart -o a.js | |
dart2js a.dart -o a.js 5.70s user 0.25s system 100% cpu 5.918 total | |
dart/ | |
› time dart2js a.dart -o a.min.js --minify | |
dart2js a.dart -o a.min.js --minify 5.72s user 0.25s system 100% cpu 5.936 total | |
dart/ | |
› ls -alh | |
total 456K | |
drwxr-xr-x 9 mfrawley wheel 306 Mar 5 12:22 ./ | |
drwxrwxrwt 14 root wheel 476 Mar 5 12:18 ../ | |
-rw-r--r-- 1 mfrawley wheel 264 Mar 5 12:21 a.dart | |
-rw-r--r-- 1 mfrawley wheel 237K Mar 5 12:21 a.js | |
-rw-r--r-- 1 mfrawley wheel 9.5K Mar 5 12:21 a.js.deps | |
-rw-r--r-- 1 mfrawley wheel 41K Mar 5 12:21 a.js.map | |
-rw-r--r-- 1 mfrawley wheel 101K Mar 5 12:22 a.min.js | |
-rw-r--r-- 1 mfrawley wheel 9.5K Mar 5 12:22 a.min.js.deps | |
-rw-r--r-- 1 mfrawley wheel 39K Mar 5 12:22 a.min.js.map | |
dart/ | |
› |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment