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

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

问题描述

我安装了 https://github.com/isaacplmann/ngx-tour 模块并集成按照指南,但我在 npm start 或 build 中发现 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.

谢谢

推荐答案

MaterialModule2.0.0-beta.3 版本中贬值,并在 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 这样的聚合模块防止工具能够对未使用的组件进行 treeshake 和模块.

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 及更高版本,请将您的 Angular 版本更新为 4.4.3 或更高版本.材料 2.0.0-beta.11 取决于 4.4.3 或更高版本.关注变更日志:

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 类已更改二月份回来).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.

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

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

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

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