I'm using dart2js
to compile dart to JavaScript on my Ubuntu server.
I'm able to use simple commands like print()
but I can't seem to use the DOM.
The code below is returning null
.
Is there something else I need to make imports work besides including the compiled out.js
?
import 'dart:html';
void main() {
print(document.querySelector('body'));
}
HTML:
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="/css/f4cacce_main_1.css" />
<script src="/js/51de0d2_main_1.js"></script>
</head>
<body>
</body>
</html>