加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – ‘md-card’不是材料2中的已知元素

发布时间:2020-12-17 08:21:25 所属栏目:安全 来源:网络整理
导读:我使用角度4和材质2处理Web应用程序.我收到此错误 parse errors:'md-card' is not a known element:1. If 'md-card' is an Angular component,then verify that it is part of this module.2. If 'md-card' is a Web Component then add 'CUSTOM_ELEMENTS_SC
我使用角度4和材质2处理Web应用程序.我收到此错误
parse errors:
'md-card' is not a known element:
1. If 'md-card' is an Angular component,then verify that it is part of this module.
2. If 'md-card' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<h2>Nothing to show</h2>
[ERROR ->]<md-card>Simple card</md-card>
"): ng:///AppAccessModule/SPLoginComponent.html@1:0
    at syntaxError

当我尝试在一个文件夹中嵌套两次的组件中使用材料时

这些是我的结构:

-----Components(folder)
  -------Auth(folder)
  --------Login(component1)
  --------Signup(component2)

但如果我下一次喜欢这样:

-------Auth(folder)
  --------Login(component 1)
  --------Signup(component2)

我没有任何问题我该怎么做才能解决这个问题?谢谢

在你的src / app / modules / app-access.module.ts中导入MdCardModule:
import { MdCardModule } from '@angular/material';

并在导入中添加它:

imports: [ 
        ....
        MdCardModule,],

如果您使用材料2中的任何其他组件,也请添加它们.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读