dart2js Polymer Dart Sample ClickCounter App is OK in Firefox, fails in Chrome -
i trying out polymer dart app under cordova. started dart editor sample app.
i utilize recent version of polymer had edit sample code. here pubspec.yaml
name: cortst description: cordova test application dependencies: polymer: '>=0.15.1+3 <0.16.0' transformers: - polymer: entry_points: - web/cortst.html
and here combined html , dart. think initialization uses new/approved technique:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>sample app</title> <link rel="import" href="clickcounter.html"> <link rel="stylesheet" href="cortst.css"> <script type="application/dart"> import 'dart:async'; import 'package:polymer/polymer.dart'; void main() { initpolymer().run( () { polymer.onready.then( (_) { new future( () { // stuff goes here! }); }); }); } </script> </head> <body> <h1>a test</h1> <div id="sample_container_id"> <click-counter count="5"></click-counter> </div> </body> </html>
to generate stand-alone javascript run dart2js via command line:
pub build --mode=debug
and these results:
dartium (37.0.2062.120 (292122) via dart editor 1.7.2) - ok run javascript on chrome (38.0.2125.111 m) - ok run javascript on firefox (33.0.3) - ok dart2js , run on chrome - no shadow dom. dart2js , run on firefox - okwhen fails click counter rendered (invisibly)
<click-counter count="5"></click-counter>
this chrome problem matters because standard web host on android chrome.
for brevity, have embedded dart script in html. same results when utilize separate .dart file.
perhaps have overlooked - wouldn't first time...
dart polymer dart-polymer dart2js
No comments:
Post a Comment