Angular 未找到'的组件工厂;CreatePrefixComponent';

Angular 未找到'的组件工厂;CreatePrefixComponent';,angular,popup,angular-material,angular6,angular-module,Angular,Popup,Angular Material,Angular6,Angular Module,我添加了一个子组件(CreatePrefixComponent),用于在单击按钮时显示弹出模式。我得到了以下错误: Error: No component factory found for CreatePrefixComponent. Did you add it to @NgModule.entryComponents? 但是我在子组件的模块中添加了CreatePrefixComponent,如下所示: import { NgModule } from '@angular/core'; i

我添加了一个子组件(CreatePrefixComponent),用于在单击按钮时显示弹出模式。我得到了以下错误:

Error: No component factory found for CreatePrefixComponent. Did you add it to @NgModule.entryComponents?
但是我在子组件的模块中添加了CreatePrefixComponent,如下所示:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MaterialModule } from '../../material.module';
import { PrefixComponent } from './prefix.component';
import { RouterModule } from '@angular/router';
import { prefixRoutes } from './prefix.routing';
import { CreatePrefixComponent } from './create-prefix/create-prefix.component';
import { MatPaginatorModule, MatTableModule } from '@angular/material';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FlexLayoutModule } from '@angular/flex-layout';

@NgModule({
  imports: [
    CommonModule,
    MaterialModule,
    RouterModule.forChild(prefixRoutes),
    MatTableModule,
    MatPaginatorModule,
    FormsModule,
    ReactiveFormsModule,
    FlexLayoutModule,
  ],
  declarations: [PrefixComponent, CreatePrefixComponent],
  entryComponents: [CreatePrefixComponent]
})
export class PrefixModule { }
我在项目中使用了棱角材料


有人能给我指一下正确的方向吗?我错过什么了吗

添加MatDialogModule并检查一次。

发布
CreatePrefixComponent
非常感谢。我的错误是我没有在material.module导入中包含MatDialogModule。一旦完成,它就被修复了