简体   繁体   中英

How do you use polymer for dart as javascript?

I've got the dart-sdk, updated my path to include the dart binaries, downloaded the tutorials and grabbed its dependencies by running "pub get". I'm going to lean toward using dart2js until dartium integrates fully with chromium, and using

dart2js clickme.dart -o clickme.dart.js

works fine from Firefox (I'm working in vim and not the Dart Editor or Spark).

But tutes using polymer don't include a main() so dart2js won't compile them. I'm not sure how to proceed. I don't know how to create an instance of TuteStopwatch, which extends PolymerElement, which might be used to create a main(), for example.

A more comfortable (IMHO) way to build is using 'pub build'.
For Polymer you need to configure a transformer in pubspec.yaml.

see How do I pass multiple entry_points to polymer transformer in pubspec.yaml?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM