在角度/材质中找不到导出材质模块 [英] export materialmodule was not found in angular/material

查看:53
本文介绍了在角度/材质中找不到导出材质模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 https://github.com/isaacplmann/ngx-tour 模块并进行了集成按照准则,但我在npm启动或构建时出现export materialmodule was not found in angular/material和其他相同类型的错误.这里可能是什么问题,以及如何解决.我已经检查过软件包,并且都已安装.

I installed https://github.com/isaacplmann/ngx-tour module and integrated as per guidelines but I am getting export materialmodule was not found in angular/material and other same kind of errors on npm start or build. what could be the issue here and how can it be resolved. I already have checked the packages and they all are installed.

谢谢

推荐答案

MaterialModule在版本 2.0.0-beta.3 中已弃用,并且在版本 2.0.0中已完全删除. -beta.11 .有关更多详细信息,请参见此 CHANGELOG .请经历重大变化.

MaterialModule depreciated in version 2.0.0-beta.3 and it was removed completely in version 2.0.0-beta.11. See this CHANGELOG for more details. Please go through the breaking changes.

MaterialModule已被删除,不再可用.如前所述 在beta.3的变更日志中,是一个汇总模块,例如MaterialModule 防止工具能够树状摇晃未使用的组件,并且 模块.

MaterialModule has been removed and is no longer available. As noted in the changelog for beta.3, an aggregate module like MaterialModule prevents tools from being able to treeshake unused components and modules.

此外,使用2.0.0-beta.11和更高版本,将您的角度版本更新为4.4.3或更高版本.材料2.0.0-beta.11取决于4.4.3或更大.赞一下CHANGELOG:

Also, with 2.0.0-beta.11 and greater, update your angular version to 4.4.3 or greater. Material 2.0.0-beta.11 depends on 4.4.3 or greater. Feom the CHANGELOG:

重大更改 Angular Material现在需要Angular 4.4.3或更高版本

Breaking changes Angular Material now requires Angular 4.4.3 or greater

现在您有两个选择:

  1. 降级到2.0.0-beta.10
  2. 包括单独的材料组件模块,以便在您的应用中使用它们.

第二种情况下

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

...
imports: [ 
    ....
    MatSelectModule,
    ‎MatButtonModule
]

最后,请记住,由于已删除2.0.0-beta.12 Md前缀,因此您应在所有位置使用Mat前缀.在2.0.0-beta.11的CHANGELOG中:

Lastly, remeber that since 2.0.0-beta.12 the Md prefix has been removed and you should use Mat prefix everywhere. From the CHANGELOG of 2.0.0-beta.11:

对于beta.11,我们已决定弃用"md"前缀 完全使用垫子"向前移动.这会影响所有的类名, 属性,输入,输出和选择器(更改了CSS类 早在二月).下一个Beta中将删除"md"前缀 释放.

For beta.11, we've made the decision to deprecate the "md" prefix completely and use "mat" moving forward. This affects all class names, properties, inputs, outputs, and selectors (CSS classes were changed back in February). The "md" prefixes will be removed in the next beta release.

并且来自2.0.0-beta.12的CHANGELOG:

And from the CHANGELOG of 2.0.0-beta.12:

重大更改 所有"md"前缀均已删除.

Breaking Changes All "md" prefixes have been removed.

查看此工作 带有单独材料模块并使用Mat前缀的StackBlitz演示 .

See this working StackBlitz demo with individual material modules and using Mat prefix.

这篇关于在角度/材质中找不到导出材质模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆