@HtmlImport URL正确的表单

时间:2015-05-16 10:47:56

标签: dart dart-polymer

我试图重构一些dart-polymer组件以使用@HtmlImport注释。

.dart

part of epimss_shared.components;

@CustomTag('associated-symptoms-form')
class AssociatedSymptomsForm extends PolymerElement {
  AssociatedSymptomsForm.created() : super.created();

  @override
  void attached() {
    super.attached();
  }
}

html的

<polymer-element name='associated-symptoms-form'>
  <template>
    <div layout horizontal center> 
      <h1>Symptoms</h1>
  </template>

   <script type = 'application/dart' src='associated_symptoms_form.dart'></script>
</polymer-element>

文库

图书馆epimss_shared.components;是导入的epimss.shared库的一部分。

@HtmlImport('../components/tooltip/tool_tip.html')
@HtmlImport('../components/misc/associated_symptoms_form.html')
library epimss_shared.components;

import 'dart:html' as dom;

import 'package:polymer/polymer.dart';
import 'package:epimss_shared/epimss_shared.dart';
import 'package:epimss_shared/epimss_shared_client.dart';

part '../components/tooltip/tool_tip.dart';
part '../components/misc/associated_symptoms_form.dart';

当我尝试使用该组件时,不会显示以下控制台错误的应用程序:

'package:epimss_shared/components/misc/associated_symptoms_form.dart': error: line 1 pos 6: url expected
part of epimss_shared.components;
     ^: package:epimss_shared/components/misc/associated_symptoms_form.dart

特殊的是这个 - 如果我创建一个具有不同名称的新组件,其中所有内容保持不变(与库中显示的工具提示组件一样),则完全没有问题!

似乎该组件的先前信息已缓存并正在重复使用。

感谢任何帮助。

0 个答案:

没有答案