Exception: NoSuchMethodError: method not found: 'whenPolymerReady'

I am using Dart SDK 1.5.3 | polymer 0.11.0 + 5 | Windows x64. When I create the created polymer application using the "Sample web application template using the" Polymer library (mobile friendly) option and launching the application, it works as expected, with an increase in the counter when the button is clicked.

Assuming page with

<script type="application/dart">
  export 'package:polymer/init.dart';
</script>

is index.html trying to reorganize the application by removing the following lines from index.html

<click-counter count="5"></click-counter>
<link rel="import" href="clickcounter.html">

leads to the following error:

Exception: NoSuchMethodError: method not found: 'whenPolymerReady'
Receiver: Instance of 'JsFunction'
Arguments: [Closure: () => dynamic] (package:polymer/src/loader.dart:115)
Breaking on exception: NoSuchMethodError: method not found: 'whenPolymerReady'

, , Dart https://www.google.com.jm/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAA&url=http%3A%2F%2Fcode.google.com%2Fp%2Fdart%2Fissues%2Fdetail%3Fid%3D19161&ei=MZq8U_nlK42KyASBkYHgCw&usg=AFQjCNHOc6MD-mhzPbDOmg8Hp5NeqVufqQ&bvm=bv.70138588,d.aWw

, , , , .

+4
8

( , <polymer-element>) polymer.html.

, clickcounter.html :

<link rel="import" href="packages/polymer/polymer.html" />

. ( 0.11).

+6

. , javascript?

<!-- <script src="packages/web_components/platform.js"></script>
     not necessary anymore with Polymer 0.14.0 -->
<script src="packages/web_components/dart_support.js"></script>
<!-- import the click-counter -->
<link rel="import" href="clickcounter.html">

:

<!-- import the click-counter -->
<link rel="import" href="clickcounter.html">
<script src="packages/web_components/platform.js"></script>
<script src="packages/web_components/dart_support.js"></script>
+1

, .

Clickcounter.html | rel= "import" href= "packages/polymer/polymer.html |". . , , polymer.html . .

    <!DOCTYPE html>

    <html>
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Sample app</title>
        <!-- <script src="packages/web_components/platform.js"></script>
             not necessary anymore with Polymer > 0.14.0 -->
        <script src="packages/web_components/dart_support.js"></script>

        <link rel="import" href="packages/polymer/polymer.html">

        <script type="application/dart">export 'package:polymer/init.dart';</script>
        <script src="packages/browser/dart.js"></script>


        <link rel="stylesheet" href="epimss_material_design.css">
      </head>
      <body>
        <h1>Epimss material design</h1>

        <p>Hello world from Dart!</p>

        <div id="sample_container_id">

        </div>

      </body>
    </html>

.

Dart SDK 1.6.0-dev.1.2 . , , . , . , , . Dart Dart-polymer , . , , .

+1

, , , , (, ). :

/lib
  /src
    /test
       clickcounter.dart
       clickcounter.html
/web
  polytest.html 

:

    <link rel="import" href="../lib/src/test/clickcounter.html">
+1

, , , , :

<!-- after the Polymer elements imports -->
<script type="application/dart">export 'package:polymer/init.dart';</script>    
<script async src="packages/browser/dart.js"></script>

<head> er, </body>. index.html . , / .

+1

, , API , .

0

,

transformers:
- polymer:
    entry_points:
    - example/index.html

, - , root

0

. , - , .

, .

pubspec.yaml. Polymer .

0

Source: https://habr.com/ru/post/1547682/


All Articles