【发布时间】:2019-02-17 20:39:07
【问题描述】:
我正在尝试遵循 Angular Dart 教程 (https://webdev.dartlang.org/angular/tutorial/toh-pt1),但在添加了一些使用 ngModel 指令的 html 后卡住了。
根据教程,为了使用 ngModel 指令,必须将“angular_forms: ^2.0.0”添加到 pubspec.yaml,导入 'package:angular_forms/angular_forms.dart' 并将“formDirectives”添加到组件指令。我做了所有这些,包括运行“pub get”来获取依赖项,但是当我运行“webdev serve”时,我收到以下错误:
[SEVERE] build_web_compilers|entrypoint on test/app_test.dart (cached):
Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
我错过了什么?
【问题讨论】:
-
我想我遇到了同样的问题。只要您只是按照教程操作并且不使用测试,您可以尝试取消注释所有内容,包括所有包含,除了以下方法:test/app_test.dart 中的 void main() {}。这对我有用。
标签: angular-dart