Ger*_*gen 9 angular-material2 angular
我使用角度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
Run Code Online (Sandbox Code Playgroud)
当我尝试在一个文件夹内嵌套两次的组件中使用材料时
这些是我的结构:
-----Components(folder)
-------Auth(folder)
--------Login(component1)
--------Signup(component2)
Run Code Online (Sandbox Code Playgroud)
但如果我下一次喜欢这样:
-------Auth(folder)
--------Login(component 1)
--------Signup(component2)
Run Code Online (Sandbox Code Playgroud)
我没有任何问题我该怎么做才能解决这个问题?谢谢
Fai*_*sal 13
在您的src/app/modules/app-access.module.ts导入中MdCardModule:
import { MdCardModule } from '@angular/material';
Run Code Online (Sandbox Code Playgroud)
并在导入中添加:
imports: [
....
MdCardModule,
],
Run Code Online (Sandbox Code Playgroud)
如果您使用材料2中的任何其他组件,也请添加它们.
| 归档时间: |
|
| 查看次数: |
23322 次 |
| 最近记录: |