有一段時間,我的印象是,Angular2 Dart codegen是發展的前進方向。不幸的是,似乎到最近我不能再使用codegen了。這是我的pubspec.yaml不起作用併產生錯誤。通過僅刪除/ transform/codegen部分,錯誤消失了。酒吧構建拋出angular2飛鏢codegen的錯誤
name: frontend
version: 0.0.1
description: Regatta frontend
author:
homepage: https://regatta.atlassian.net
documentation:
environment:
sdk: '>=1.19.0 <2.0.0'
dependencies:
angular2: 3.0.0-alpha
angular2_components: 0.3.1-alpha
reflectable: 1.0.1
sass_transformer: 0.1.2+1
greencat: 0.0.2
browser: 0.10.0+2
http: 0.11.3+9
stream_transformers: 0.3.0+3
dev_dependencies:
test: 0.12.19
dart_to_js_script_rewriter: 1.0.2
dart_style: 0.2.16
pageloader: 2.2.5
mockito: 1.0.1
angular_test: 1.0.0-alpha+5
transformers:
- sass_transformer
- angular2/transform/codegen:
platform_directives:
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
platform_pipes:
- 'package:angular2/common.dart#COMMON_PIPES'
entry_points: web/main.dart
resolved_identifiers:
BrowserClient: 'package:http/browser_client.dart'
Client: 'package:http/http.dart'
- angular2/transform/reflection_remover:
$include:
- test/**_test.dart
- web/main.dart
- reflectable:
entry_points:
- web/main.dart
formatted: true
- test/pub_serve:
$include: test/**_test.dart
- dart_to_js_script_rewriter
錯誤消息
pub build
Loading source assets...
Loading angular2/transform/codegen, dart_to_js_script_rewriter, sass_transformer, reflectable, test/pub_serve and reflectable/src/transform_import transformers...
Loading angular2 and angular2/transform/reflection_remover transformers... (3.9s)
[Error from DirectiveMetadataLinker on frontend|lib/components/navigation_bar_component/navigation_bar_component.ng_summary.json with input frontend|lib/components/navigation_bar_component/navigation_bar_component.ng_meta.json]:
Missing identifier "materialProviders" needed by "NavigationBarComponent" from metadata map
[Error from DirectiveMetadataLinker on frontend|lib/components/event_list_component/event_list_component.ng_summary.json with input frontend|lib/components/event_list_component/event_list_component.ng_meta.json]:
Missing identifier "materialProviders" needed by "EventListComponent" from metadata map
[Error from DirectiveMetadataLinker on frontend|lib/components/event_detail_component/event_detail_component.ng_summary.json with input frontend|lib/components/event_detail_component/event_detail_component.ng_meta.json]:
Missing identifier "materialProviders" needed by "EventDetailComponent" from metadata map
[Error from TemplateCompiler on frontend|lib/app_component.ng_meta.json]:
Could not find Directive/Pipe entry for name: NavigationBarComponent
. Please be aware that Dart transformers have limited support for reusable, pre-defined lists of Directives/Pipes (aka "directive/pipe aliases"). See for details.
Building frontend... (12.2s)
嗨法比安 我快速看了一下 - 它確實看起來確實有用 - 例如畫廊應用程序(https://dart-lang.github.io/angular2_components_example/)是使用相同的配置構建的,的時間代碼生成: https://github.com/dart-lang/angular2_components_example – matanlurey