Angular6 matTextareaAutosize不适用于角度材质6.4.2

Angular6 matTextareaAutosize不适用于角度材质6.4.2,angular6,angular-material-6,Angular6,Angular Material 6,我正在尝试对角材质6.4.2中的textarea应用自动调整大小,如下所示- <mat-form-field> <textarea matInput [matTextareaAutosize]="true" placeholder="Task description" formControlName="description" [errorStateMatcher]="ErrorMatcher"> </textarea> </m

我正在尝试对角材质6.4.2中的textarea应用自动调整大小,如下所示-

<mat-form-field>
      <textarea matInput [matTextareaAutosize]="true" placeholder="Task description" formControlName="description" [errorStateMatcher]="ErrorMatcher">
       </textarea>
</mat-form-field>

但它抛出了以下错误:无法绑定到“matTextareaAutosize”,因为它不是“textarea”的已知属性


我的代码怎么了?

在你的
app.moude

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

然后将
MatInputModule
添加到您的
app.moude
imports

文档中,他们声明您应该使用cdkTextareaAutosize指令