找不到PermissionsDialogComponent的组件工厂

我有一个问题。我在与原先使用的权限不同的组件中使用了权限对话框组件。我已经将其复制到我想使用它的组件中,并在按下按钮时显示它,而我得到的错误是错误。

找不到用于PermissionsDialogComponent的组件工厂。您是否将其添加到@ NgModule.entryComponents?

我在声明它的位置和entryComponents中有user.module(见下文),并且在app.module中也导入了users.module。

我的users.module

import { NgModule } from "@angular/core";
import { InvitationsComponent } from "./invitations/invitations.component";
import { UserListComponent } from "./user-list/user-list.component";
import { PermissionsComponent } from "./permissions/permissions.component";
import { Routes, RouterModule } from "@angular/router";
import { MatIconModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatTableModule, MatDialogModule, MatToolbarModule, MatSlideToggleModule, MatOptionModule, MatSelectModule, MatCheckboxModule, MatDatepickerModule, MatMenuModule, MatRippleModule } from "@angular/material";
import { FuseSharedModule } from "@fuse/shared.module";
import { InvitationsListComponent } from "./invitations/invitations-list/invitations-list.component";
import { PermissionsDialogComponent } from "./permissions/permissions-dialog/permissions-dialog.component";
import { UserTableComponent } from "./user-list/user-table/user-table.component";
import { SelectedBarComponent } from "./user-list/selected-bar/selected-bar.component";
import { UserDialogComponent } from "./user-list/user-dialog/user-dialog.component";
import { FuseConfirmDialogModule, FuseSidebarModule } from "@fuse/components";

const routes: Routes = [
  {
    path: "invitations",
    component: InvitationsComponent
  },
  {
    path: "userlist",
    component: UserListComponent
  },
  {
    path: "permissions",
    component: PermissionsComponent
  }
];

@NgModule({
  declarations: [
    InvitationsComponent,
    UserListComponent,
    PermissionsComponent,
    InvitationsListComponent,
    PermissionsDialogComponent,
    UserTableComponent,
    SelectedBarComponent,
    UserDialogComponent
  ],
  imports: [
    RouterModule.forChild(routes),
    MatIconModule,
    MatFormFieldModule,
    MatInputModule,
    MatButtonModule,
    MatTableModule,
    MatDialogModule,
    MatToolbarModule,
    MatSlideToggleModule,
    MatOptionModule,
    MatSelectModule,
    MatCheckboxModule,
    MatMenuModule,
    FuseSharedModule,
    FuseConfirmDialogModule,
    FuseSidebarModule,
  ],
  entryComponents: [PermissionsDialogComponent, UserDialogComponent],

  exports: [
    PermissionsDialogComponent

  ]
})
export class UsersModule { }





但这给了我这个错误...

我该如何解决?

评论