问题
After announcing new strategy for Dart, i decided to change include from
<script type="application/dart" src="/dart/script.dart"></script>
to
<script type="text/javascript" src="/dart/script.dart.js"></script>
But in that case js-interop seems broken. dart:js.context
is empty.
Is there any workarounds for this?
回答1:
It looks like you are missing this script tag:
<script data-pub-inline src="packages/browser/dart.js"></script>
There is also an open issue to fix this http://dartbug.com/23005
来源:https://stackoverflow.com/questions/29406133/dart-js-interop-not-working-if-dart-file-isnt-included