首页 > 解决方案 > 不能使用角材料的选择

问题描述

每当我尝试从角度材料(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!

标签: angularselectangular-material

解决方案


如果您将材料导入导出到另一个模块,只需尝试将 MatSelectModule 导入 AppModule。


推荐阅读