dart - Dart Todo应用

标签 dart dart-polymer

我正在研究dart todo示例应用程序。我没有更改任何代码,但在编辑器中看到很多花样。

    <polymer-element name="simple-router">
        <script type="application/dart;component=1" 
         src="simple_router.dart"></script>
    </polymer-element>

我看到的错误读取。

Wrong script type, expected type="application/dart".



我不明白这是什么意思。当我剥离; component = 1时。确实破坏了应用程序。

最佳答案

这是在Polymer中关于">= 0.10.5 <0.11.0"的有效代码,但有一些更改。
;component=1应该从所有脚本标签中删除。

条目页面中的import和script标签应该看起来像

<html>
  <head>
    <title>core-ajax-dart</title>

    <!-- when the project uses polymer -->
    <!-- <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 individual polymer elements -->
    <link rel='import' href='packages/core_elements/core_ajax_dart.html'>
  </head>
  <body>
    <core-ajax-dart
      url="http://gdata.youtube.com/feeds/api/videos/"
      params='{"alt":"json", "q":"chrome"}'
      handleAs="json"
      auto></core-ajax-dart>

    <!-- if you have a custom script file that contains a main() method -->
    <script type="application/dart" src="core_ajax_dart.dart"></script>

    <!-- else if you don't have a custom script file with a main() method 
    <script type="application/dart">export 'package:polymer/init.dart';</script>
  </body>
</html>

请参阅此处如何实现自定义main方法。
how to implement a main function in polymer apps

关于dart - Dart Todo应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24716301/

相关文章:

flutter - 在 Flutter 中,是否可以将我的 MaterialApp 的 themeData 设置为使用大写作为所有文本值的默认值?

image - 如何在 dart 的 canvas2d 中缓存稍后要绘制的图像?

types - 在Polymer Dart中使用带$的强类型不起作用

dart - 似乎设置了一个单向数据绑定(bind),即使它应该是双向的

dart - 无法在我的聚合物组件中查询选择器

flutter - Dart&SQFLite&DatabaseException

flutter - 如何使用回调方法获取 Flutter 中按钮的文本?

flutter - 在performLayout()期间引发了PageView NoSuchMethodError

dart - 在 Dart 中使用 Polymer UI 元素

dart - 升级到聚合物 : ^1. 0.0-rc.10 和可反射 : ^0. 5.0 后无法运行应用程序