Skip to content

Instantly share code, notes, and snippets.

@jakemac53
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakemac53/a5d272982ae3232d4dff to your computer and use it in GitHub Desktop.
Save jakemac53/a5d272982ae3232d4dff to your computer and use it in GitHub Desktop.
// Dynamically injects an html import, but gives the warning
// `URL must be imported by main Dart script: foo.dart`
@HtmlImport('foo.html')
library foo;
import 'package:web_components/web_components.dart';
<script type="application/dart" src="foo.dart"></script>
import 'package:foo/foo.dart';
import 'package:initialize/initialize.dart' as init;
main() {
// Crawls imports looking for @HtmlImport and does dynamic injection
init.run();
}
<script src="application/dart" href="index.dart"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment