Error: No component factory found for 'component'. Did you add it to @NgModule.entryComponents?
Error: No component factory found for 'component'. Did you add it to @NgModule.entryComponents?
我收到以下错误:
Error: No component factory found for DropdownComponent. Did you add it to @NgModule.entryComponents?
我知道我应该将组件 (DropdownComponent
) 添加到 EntryComponents
:
entryComponents: [
DropdownComponent
],
我已将此添加到 app.module.ts,但我仍然收到相同的错误。
我创建了一个 Stackblitz。
如果您打开控制台并双击其中一个网格单元格,您将看到错误
如果你已经在app.modules.ts
中添加了,那么你还需要在组件的entryComponents
中添加DropdownComponent
,你要显示的地方。如下所示:
@Component({
selector: 'abc',
templateUrl: './abc.component.html',
styleUrls: ['./abc.component.scss'],
entryComponents: [DropdownComponent]
})
希望对您有所帮助。
我收到以下错误:
Error: No component factory found for DropdownComponent. Did you add it to @NgModule.entryComponents?
我知道我应该将组件 (DropdownComponent
) 添加到 EntryComponents
:
entryComponents: [
DropdownComponent
],
我已将此添加到 app.module.ts,但我仍然收到相同的错误。
我创建了一个 Stackblitz。 如果您打开控制台并双击其中一个网格单元格,您将看到错误
如果你已经在app.modules.ts
中添加了,那么你还需要在组件的entryComponents
中添加DropdownComponent
,你要显示的地方。如下所示:
@Component({
selector: 'abc',
templateUrl: './abc.component.html',
styleUrls: ['./abc.component.scss'],
entryComponents: [DropdownComponent]
})
希望对您有所帮助。