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 と @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');
}
}
Dartium コンソール:
GET http://localhost:8080/lib/root/root.html 404 (Not Found)
ここでポリマーのドキュメントを読んでいます。
「lib の下にある非 Dart ファイルは、lib の下にアセットをインポートするために相対パスを使用する必要があります:」
https://www.dartlang.org/polymer/app-directories.html
<!-- lib/a5/a6/a6.html imports lib/a4.html -->
<link rel="import" href="../../a4.html">
Python のシンプルな Web サーバーの実行は機能しているように見えるため、問題は pub serve にあります。
python -m SimpleHTTPServer
質問: lib フォルダーからネストされた html ファイルを操作するには、configure pub サービスをどのように使用しますか?