我试图使用angular-material2在我的组件中插入输入字段.这是我的
HTML:
<md-form-field> <input type="text"> </md-form-field>
md-form-field must contain a MdFormFieldControl. Did you forget to add mdInput to the native input or textarea element?
解决方法
首先,您需要在app.module中导入MdFormFieldModule,MdInputModule模块.然后,您需要在< input>中添加mdInput指令.
<md-form-field> <input type="text" mdInput> </md-form-field>