angular-dart - Angular Dart 教程 - 无法找到某些源的模块
问题描述
我正在尝试遵循 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).
我错过了什么?
解决方案
我有同样的问题。我认为它没有在 tute 中明确提及,但是在将 angular_forms 依赖项添加到 pubspec.yaml 文件后,您需要使用以下方法引入这个新依赖项:
pub get
希望能帮助到你!
推荐阅读
- linux - 当需要用户输入时,如何在启动时自动运行应用程序?
- angular - 使用 angularx-flatpickr 在 Angular 上加载语言环境时出错
- php - 如何避免带有大量换行符的文本?
- swift - 如何保持用户在firebase中的连接?
- ios - retrieveConnectedPeripheralsWithServices 不返回当前连接到系统的设备
- c# - 尝试使用 SaveChanges(实体框架核心)时,作为对象的属性变为空,这是为什么呢?
- android - 自定义异步任务的实现不起作用
- c# - 安装程序项目 - 使用提升的权限启动自定义操作
- javascript - 从 DataTable 中的逗号分隔列填充下拉菜单
- xamarin - F# Fabulous/Xamarin 内存管理,为什么我不能使用(自动处置)这个流?