2011-11-07, 11:42 PM
There are binaries for the Dart editor available now. It checks for errors on saving a file (as opposed to as you type), has completion after typing a "." (but not before unless you press ctrl+space), F3 to jump to the declaration of something, and has a button for compiling to javascript and viewing the page in a browser.
Something that tripped me up is that the Hello World in the new project template does not work in Firefox or IE because it uses the innerText property, which I now know is non-standard.
Something that tripped me up is that the Hello World in the new project template does not work in Firefox or IE because it uses the innerText property, which I now know is non-standard.
Code:
#import('dart:dom');
class HelloWorld {
HelloWorld() {
}
void run() {
write("Hello World!");
}
void write(String message) {
// the DOM library defines a global "window" variable
HTMLDocument doc = window.document;
HTMLParagraphElement p = doc.createElement('p');
p.innerText = message;
doc.body.appendChild(p);
}
}
void main() {
new HelloWorld().run();
}
