在做了Pub Get和Pub升级之后,我的定制聚合元素不再工作了。在我看来
<script type="application/dart" src="view.dart"></script>被错误地解释。在我的index.html_bootstrap.dart中,它被列出为:import 'dialog%5Cview.dart' as smoke_1; "%5C“(\)无论如何都应该是斜杠(/),我很确定它不应该被转义。我在64位Windows的省道稳定版(1.8.5)和开发版(1.9.0)上试了一下。
我已经尝试将我的包恢复到以前的版本,但是由于我没有在我的pubspec文件中限制它们,所以我无法在更改之前确定哪个版本可以工作。在另一个省道聚合物项目,我正在工作,我使用相同的设置(延伸的聚合物元素),它仍然工作。index.html_bootstrap.dart中的等效位置是:import 'dialog/view.dart' as smoke_1;
(编辑)一些(缩短)代码:
/web/对话框/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/对话框/错误/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/对话框/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 /升级之前,这个问题非常好,并且没有通过修复缓存来解决。使用类似结构的项目仍然工作良好。
发布于 2015-03-10 18:22:22
这就解决了这一问题:
pubspec.yaml
code_transformers:'<= 0.2.5‘
https://stackoverflow.com/questions/28963510
复制相似问题