Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular material 使用MatIcon中的MatTooltip在Angular 8中导致问题_Angular Material_Tooltip_Angular8 - Fatal编程技术网

Angular material 使用MatIcon中的MatTooltip在Angular 8中导致问题

Angular material 使用MatIcon中的MatTooltip在Angular 8中导致问题,angular-material,tooltip,angular8,Angular Material,Tooltip,Angular8,我尝试在显示后缀图标的输入中显示工具提示消息。我想我做了文档上说的每件事,但总是得到一个错误,而不是我想要的 ERROR Error: No component factory found for TooltipComponent. Did you add it to @NgModule.entryComponents? 组件技术 @NgModule({ declarations: [ MyComponent ], imports: [ MatTooltipModu

我尝试在显示后缀图标的输入中显示工具提示消息。我想我做了文档上说的每件事,但总是得到一个错误,而不是我想要的

ERROR Error: No component factory found for TooltipComponent. Did you add it to @NgModule.entryComponents?
组件技术

@NgModule({
  declarations: [
    MyComponent
  ],
  imports: [
    MatTooltipModule
]
Component.html

<mat-form-field>
 <input matInput placeholder="placeHolder" formControlName="myFormControl">
 <mat-icon matSuffix
   matTooltip="My tooltip comes here"
   matTooltipPosition="left">
    help_outline
 </mat-icon>
</mat-form-field>

提纲

错误:找不到ToolTiComponent的组件工厂。您是否已将其添加到@NgModule.entryComponents?
从这个错误中,我可以告诉您需要将TooltipComponent添加到模块中的EntryComponents中

@NgModule({
  declarations: [
    MyComponent
  ],
  imports: [
    MatTooltipModule
],
entryComponetns: [TooltipComponent]