Dart 自定义角省道组件包

Dart 自定义角省道组件包,dart,angular-dart,dart-pub,dart-html,Dart,Angular Dart,Dart Pub,Dart Html,我有一个我创建的角度省道组件,我正试图在我的主要项目中使用它。我正在使用路径包来引用它。组件的构造函数(在dart文件中)正在被调用,但是我得到了一个错误,即找不到.css和.html文件。它寻找它们的路径似乎存在,所以我不确定它为什么找不到它们 我在代码中使用了其他自定义组件,但是没有与它们相关联的html或css文件,它们很好,似乎仅限于html和css文件 下面是我的代码片段 test.dart位于test\u组件/lib/test\u组件中/ library TestCom; impo

我有一个我创建的角度省道组件,我正试图在我的主要项目中使用它。我正在使用路径包来引用它。组件的构造函数(在dart文件中)正在被调用,但是我得到了一个错误,即找不到.css和.html文件。它寻找它们的路径似乎存在,所以我不确定它为什么找不到它们

我在代码中使用了其他自定义组件,但是没有与它们相关联的html或css文件,它们很好,似乎仅限于html和css文件

下面是我的代码片段

test.dart位于test\u组件/lib/test\u组件中/

library TestCom;

import 'package:angular/angular.dart';

@Component(
    selector: 'tester',
    templateUrl: 'test.html',
    cssUrl: 'test.css')
class TestComponent {
 String t = "this is the test component";

 TestComponent() {
    print("Test Component STARTED");
  }
}
<h3>{{t}}</h3>
test.html位于test\u component/lib/test\u component中/

library TestCom;

import 'package:angular/angular.dart';

@Component(
    selector: 'tester',
    templateUrl: 'test.html',
    cssUrl: 'test.css')
class TestComponent {
 String t = "this is the test component";

 TestComponent() {
    print("Test Component STARTED");
  }
}
<h3>{{t}}</h3>
main.dart位于main/src/main/dart/web中

import 'package:TestModule/test_component/test.dart';

class MyAppModule extends Module {
  MyAppModule() {
    bind(TestComponent);
  }
}
index.html位于main/src/main/dart/web中/

<tester></tester>
在我运行pub-get之后,在我的主项目的packages文件夹中,TestModule/test\u component/存在,其中包含test.css、test.dart和test.html。我不知道为什么当我运行它时,它找不到.html和.css文件

这是我运行控制台时在控制台中显示的内容

Observatory listening at http://127.0.0.1:54254/
Test Component STARTED
index.html:1 GET http://127.0.0.1:3030/packages/TestModule/test_component/test.css 404 (Not Found)
index.html:1 GET http://127.0.0.1:3030/packages/TestModule/test_component/test.html 404 (Not Found)
2 HTTP 404: <html><head><title>404 Not Found</title></head><body>File not found</body></html>

STACKTRACE:
null
天文台监听http://127.0.0.1:54254/
测试组件已启动
html:1gethttp://127.0.0.1:3030/packages/TestModule/test_component/test.css 404(未找到)
html:1gethttp://127.0.0.1:3030/packages/TestModule/test_component/test.html 404(未找到)
2 HTTP 404:404未找到文件未找到
堆栈跟踪:
无效的
试试这个

 name: TestModule
    dependencies:
      angular: "^1.1.2+2"
      browser: any
    transformers:
    - angular:
        html_files:
          - packages/TestModule/test_component/test.html

但是,对于css文件,我认为您只需要将它们与组件的Dart文件放在同一个文件夹中。

GitHub repo中有一些与此相关的问题,但我不知道当前状态如何。