首页 > 解决方案 > 角度应用程序中的材料设计问题

问题描述

嗨,我是角度的初学者,我想在我的应用程序中使用材料基本输入字段,我按照下面的博客来满足我的要求https://material.angular.io/components/input/overview但是当我运行我的代码时出错

Template parse errors:
'mat-form-field' is not a known element:
1. If 'mat-form-field' is an Angular component, then verify that it is part of this module.
2. If 'mat-form-field' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the

下面我给了我的stackblizz链接请帮助我我在哪里做错了

https://stackblitz.com/edit/angular-ux8kqk

标签: angularangular-material

解决方案


你还没有MatInputModule在你的.module.ts

在您的app.module.ts

import {MatInputModule} from '@angular/material/input';

imports : [
 // Other modules
 MatInputModule
]

推荐阅读