我在角度1.0.0项目中遇到此错误,我不知道这意味着什么,应该做些什么。我不理解链接https://github.com/angular/di.dart/wiki/Uninitialized-Module.DEFAULT_REFLECTOR-error
中的解释我的项目在库中声明了一个依赖项,声明了angular中的依赖项。所以我的项目没有角度的直接依赖,我不能在 pubspec.yaml 文件中声明变换器。
答案 0 :(得分:1)
我在使用main() async
时遇到了同样的错误 - 所以删除async
并回到传统的Future-base版本就是解决方案。
答案 1 :(得分:0)
Angular现在使用静态生成的内容。组件的html文件在pub install或pub serve
期间处理pubspec.yaml 文件需要:
transformers:
- angular:
html_files:
- web/controllers/error_warning_controller.html
- web/controllers/http_interceptor_controller.html
- web/controllers/notify_tray_controller.html
- web/controllers/notify_desktop.html
- web/controllers/panel_controller.html
- web/controllers/window_controller.html
dart_sdk: /usr/local/opt/dart/libexec
如果你使用一个依赖于角度的库你需要直接依赖角度转换才能工作,那么它也无法工作,我可以解决依赖声明两次,一个用于库的一个用于使用该库的项目。