angular - 不能使用角材料的选择
问题描述
每当我尝试从角度材料(https://material.angular.io/components/select/overview)中使用“选择”时,我都会收到此错误。我虽然导入了 MatSelectModule。
core.js:6272 错误 NullInjectorError: R3InjectorError(RootModule)[InjectionToken mat-select-scroll-strategy -> InjectionToken mat-select-scroll-strategy -> InjectionToken mat-select-scroll-strategy -> InjectionToken mat-select-scroll- strategy]: NullInjectorError: No provider for InjectionToken mat-select-scroll-strategy!
解决方案
如果您将材料导入导出到另一个模块,只需尝试将 MatSelectModule 导入 AppModule。
推荐阅读
- java - 当每个模块都有特定版本时,如何在 Nexus 中将工件关联到一个业务版本?
- java - 使用 letencrypt 证书在 Wildfly 19 上设置 ssl 证书
- ios - 没有这样的文件或目录,但文件存在 Xcode
- angular - 如何将 Angular 表单数据转换为服务器将接受的 POST 请求?
- angular - 不能使用角材料的选择
- android - 尝试构建 APK 时失败
- javascript - React Native - 如何在另一个函数中使用'useState()'
- sql-server - 从 VM 将数据库 .bak 文件还原到 Azure 弹性池数据库
- arrays - json响应与laravel中给出的sample参数不一样
- performance-testing - In K6 - 如何在单个脚本中打破单个事务的 TPS