Dart 发布服务未在lib下找到文件
我正在使用Angular版本2的开发者预览进行测试,并使用pub-serve提供它 我想建立一个约定,在/lib/中构建我的文件,如下所示:Dart 发布服务未在lib下找到文件,dart,angular,Dart,Angular,我正在使用Angular版本2的开发者预览进行测试,并使用pub-serve提供它 我想建立一个约定,在/lib/中构建我的文件,如下所示: └── project/lib/root ├── root.css ├── root.dart └── root.html └── project/web/ ├── index.html └── index.dart 在我的/web/index.dart文件中,我成功地从root.dart初始化了@View和@Co
└── project/lib/root
├── root.css
├── root.dart
└── root.html
└── project/web/
├── index.html
└── index.dart
在我的/web/index.dart文件中,我成功地从root.dart初始化了@View和@Component
然而,当我通过pub-serve在Dartium中预览时,我似乎无法提供/lib/root/root.html
@Component(
selector: 'jroot'
)
@View(
templateUrl: '../../lib/root/root.html',
directives: const [If]
)
class Root {
String content = 'Root - This is the entry point to the component';
List<Times> list;
Root(){
print('RootComponent Init');
}
}
我一直在阅读polymer的文件,其中指出:
“lib下的非Dart文件必须使用相对路径导入lib下的资产:”
https://www.dartlang.org/polymer/app-directories.html
运行python simple web服务器似乎是可行的,因此问题在于pub-serve:
python-msimplehttpserver
问题:如何配置发布服务来处理lib文件夹中的嵌套html文件?确保您的pubspec.yaml转换器上有正确的入口点:
name: 'project'
version: 0.0.1
dependencies:
angular2: '2.0.0-alpha.23'
browser: any
transformers:
- angular2:
entry_points:
- web/index.dart //this
reflection_entry_points:
- web/index.dart //this
那么我认为这应该行得通
templateUrl: 'packages/project/root/root.html',
或者只是
templateUrl: 'root.html',
templateUrl: 'packages/project/root/root.html',
templateUrl: 'root.html',