gpt4 book ai didi

angular-material - 'mat-select' 在 Angular 5 中构建时不是已知元素

转载 作者:行者123 更新时间:2023-12-03 18:40:58 25 4
gpt4 key购买 nike

我在我的 Angular 5 项目中使用延迟加载,并且我有一个共享模块,其中导入了所有 Material 组件,并且我在我的另一个模块中使用这个共享模块作为 Material 模块。

所有组件在开发模式下都可以正常工作,但是当我为生产进行构建时,它显示错误 'mat-select'不是不显示任何行号的已知元素。

我在我的组件中导入了共享模块,这些模块使用了有角 Material ,也在我的 app.component.ts 中。文件。我到处搜索,但没有运气。

最佳答案

在您各自的模块中添加以下内容。

import { MatSelectModule } from '@angular/material';

MatSelectModule在进口。

关于angular-material - 'mat-select' 在 Angular 5 中构建时不是已知元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52204922/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com