Dart polymer : binding html files to scripts results in broken bootstrap. Dart 包含 "%5C"个字符

标签 dart polymer smoke

在进行 Pub Get 和 Pub Upgrade 之后,我的 custom-PolymerElements 不再起作用。在我看来,

<script type="application/dart" src="view.dart"></script>

被错误解释。在我的 index.html_bootstrap.dart 中,它被列为:import 'dialog%5Cview.dart' as smoke_1;无论如何,“%5C”(\)应该是一个斜杠(/),我很确定它不应该被转义。我使用 64 位 Windows 的 dart stable (1.8.5) 和 dev (1.9.0) 版本进行了尝试。

我已经尝试将我的包恢复到他们以前的版本,但由于我没有在我的 pubspec 文件中限制它们,我无法确定在我的更改之前哪些版本有效。在我正在研究的另一个 Dart polymer 项目中,我使用相同的设置(扩展 polymer 元素)并且它仍然有效。 index.html_bootstrap.dart 中的等效位置为:import 'dialog/view.dart' as smoke_1;
(编辑)一些(缩短的)代码:

/web/dialog/error/view.html
<link rel="import" href="packages/polymer/polymer.html">
<link rel="import" href="packages/paper_elements/paper_dialog.html">
<link rel="import" href="packages/core_elements/core_animated_pages.html">

<polymer-element name="error-view">
<template>
    <style>
        paper-dialog {
            margin-top: 20px;
            height: 400px;
            width: 600px; }     
    </style>
    <paper-dialog id="extendedNode" heading="{{dialogtitle}}" vertical autoCloseDisabled=true transition="paper-transition-center" opened=true>
      <content> 
      <core-animated-pages selected="{{page}}" valueattr="id" transitions="hero-transition cross-fade">
            <section id="0">
                    <p  cross-fade>A system error occured while connecting with the server.</p>
                    <br>
                    <p  cross-fade>Error message: {{dialogtext}}</p>
          </section>       
    </core-animated-pages>
    </content>
    </paper-dialog>
  </template>

<script type="application/dart" src="view.dart"></script>
</polymer-element>

/web/dialog/error/view.dart
import 'package:polymer/polymer.dart';
import '../view.dart'; // <- the base class 'DialogView'

  @CustomTag('error-view')
  class ErrorView extends DialogView{

    ErrorView.created() : super.created(){
    componentName = 'error-view';
    this.dialogtitle = 'System Error';
  }

}

/web/dialog/view.dart
import 'package:polymer/polymer.dart';
import 'dart:html';
import 'package:intl/intl.dart';

import '../locale/de.dart' as de;

class DialogView extends PolymerElement {
   @observable int page;
   //there are a lot of helper functions and variables in here
}

我使用了许多对扩展基本组件的组件(它没有 view.html,但只有一个 view.dart 允许我在一个列表中保存和操作不同的对话框。在我执行 Pub Get/Upgrade 和没有通过修复缓存解决。使用类似结构的项目仍然可以正常工作。

最佳答案

这暂时解决了它:

发布规范.yaml

code_transformers: '<= 0.2.5'

关于 Dart polymer : binding html files to scripts results in broken bootstrap. Dart 包含 "%5C"个字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28963510/

相关文章:

string - 如何查找字符串的字节长度

swift - Flutter Desktop : Firebase Auth could not find a valid GoogleService-Info. plist

firebase - 我如何在Flutter中将数据从一个小部件传递到另一个小部件?

javascript - Polymer:在自定义元素中使用 querySelector 而不是 "this.$."

javascript - Three.js - 如何使用 Three.js 创建烟雾?

testing - 移动应用程序测试和 Web 应用程序测试有什么区别

inheritance - 如何在 Dart 中调用 super 构造函数?

html - Adsense 不适用于 Polymer 设计

dart - Paper-textarea在AngularDart组件中为只读

javascript - 如何在 Javascript 或 CSS 中实现完整的背景烟雾效果